Prepare pastry and line one 23 cm pie plate. In small saucepan, combine sugar and flour, mixing well. Stir in milk. Bring to boil while stirring. Reduce heat and simmer until slightly thickened. In bowl, beat egg yolks slightly and add small amount hot mixture. Pour egg mixture into saucepan. Add margarine and vanilla. Cool. Peel and slice apples, sprinkle with lemon juice. In skillet, combine margarine, sugar and nutmeg and melt. Add apples; saute, stirring occasionally. Cook until almost tender, about 5 minutes. Remove from heat. Pour into pastry shell. Pour cooled filling over apples. In saucepan, melt preserves and spread evenly over apple mixture. Top with pastry. Beat egg yolk and water and brush on pastry. Bake in 425 degree oven 40 min. or until golden. (pastry for 2 crust pie)