Melt margarine in a medium saucepan over medium heat. Add leek and garlic; stir well. Cover and cook 5 minutes or until the leek is tender. Remove from heat; set aside.
Arrange one-third of potato slices in an 11 x 7-inch baking dish coated with cooking spray; top with half of leek mixture. Repeat layers, ending with potato slices.
Combine milk, salt, pepper, nutmeg, and egg in a bowl; stir well with a wire whisk. Pour over potato mixture. Bake, uncovered, at 425° for 30 minutes. Sprinkle cheese over potato mixture, and bake for an additional 15 minutes or until browned.