Preheat oven to 375°F (190°C) and lightly grease a 9×13-inch baking dish.
- Peel (if desired) and slice potatoes into ⅛-inch thick slices using a mandoline or sharp knife.
- In a saucepan, melt butter over medium heat. Add onion and garlic, cooking until softened.
- Stir in flour and cook for 1 minute, forming a roux. Gradually whisk in milk and cream until smooth.
- Simmer sauce for 3–4 minutes until slightly thickened. Stir in salt, pepper, and optional nutmeg or cayenne. Add half the cheddar and all the Parmesan, stirring until melted.
- Spread a thin layer of sauce in the baking dish. Layer potatoes, slightly overlapping, then spoon more sauce on top. Repeat until all potatoes and sauce are used.
- Sprinkle the remaining cheddar cheese on top. Cover loosely with foil and bake 40 minutes.
- Uncover and bake an additional 25–30 minutes, until golden and bubbly and potatoes are fork-tender.
- Let rest 10 minutes before serving. Garnish with fresh parsley or thyme.