Preparation: Wash, peel, and thinly slice the potatoes. Use a mandoline slicer for uniform thickness.
Making the Sauce: Melt butter in a saucepan over medium heat. Add flour and stir constantly to form a smooth paste. Gradually whisk in milk and cream, ensuring there are no lumps. Add onion powder, garlic powder, salt, and black pepper. Cook, stirring frequently, until the sauce thickens.
Layering the Dish: Preheat oven to 350°F (175°C). Grease a baking dish with butter. Layer a third of the potatoes at the bottom, pour a third of the sauce over them, and sprinkle a third of the mozzarella and cheddar on top. Repeat this process two more times, ending with a generous layer of cheese on top.
Baking: Cover the dish with aluminum foil and bake for 45 minutes. Remove the foil and bake for an additional 15-20 minutes until the top is golden brown and bubbly. Let cool before serving.