In a 12-inch non-stick skillet heat 2 tablespoons oil over moderate heat until hot but not smoking and cook half of eggplant, stirring frequently, until golden brown and tender, about 6 minutes. Transfer cooked eggplant to a 2- to 2 1/2-quart gratin dish or other shallow baking dish. Cook remaining eggplant in 2 tablespoons oil in same manner and add to dish. In skillet cook onions, garlic, and red pepper flakes in remaining tablespoon oil over moderately low heat, stirring, until onions are softened. Add bell peppers and cook over moderate heat, stirring occasionally, until tender, about 8 minutes. Stir in remaining ratatouille ingredients and simmer, stirring occasionally, 5 minutes. Season mixture with salt and additional pepper and spoon evenly over eggplant. Preheat oven to 375°F. In a 1 1/2-quart heavy saucepan melt butter over moderately low heat and whisk in flour. Cook roux, whisking, 3 minutes and whisk in milk in a stream and salt and pepper to taste. Bring sauce to boil, whisking constantly, and simmer, whisking, 2 minutes. Stir in Parmesan and remove pan from heat. In a heatproof bowl whisk yolks together and whisk in about one fourth of sauce. Whisk yolk mixture into remaining sauce. Spoon custard over ratatouille. Ratatouille may be prepared up to this point 4 hours ahead and chilled, covered. Bake ratatouille in middle of oven 45 minutes, or until custard is lightly browned. Cool ratatouille 10 minutes before serving.