Preheat your oven to 375°F.
Butter the baking dish.
Melt butter in a large saucepan.
Add chopped onion and cook until soft.
Stir in garlic and cook for 1 minute.
Slowly pour in the cream and milk.
Add salt, pepper, and nutmeg.
Simmer for 5 minutes, then turn off the heat.
Layer half of the sliced potatoes in the dish.
Pour half of the cream mixture over the potatoes.
Sprinkle half of the cheeses on top.
Repeat with the remaining potatoes, cream, and cheese.
Cover the dish with aluminum foil.
Bake for 40 minutes.
Remove the foil and bake for another 20 minutes.
Let the dish cool for 10 minutes before serving.