Start by preheating your oven to 375°F (190°C). Grease a baking dish with butter or cooking spray to prevent sticking.
Peel and thinly slice the root vegetables. A mandoline slicer works best here, giving you uniform slices that cook evenly. Place all the veggies in a large mixing bowl.
Melt butter in a saucepan over medium heat. Add sliced onion and garlic, cooking until they’re soft and aromatic. This step enhances the overall flavor base of the dish.
Sprinkle flour over the onions and garlic, stirring constantly to make a roux. Gradually add milk, whisking as you go to prevent lumps. After the sauce thickens, lower the heat and stir in cheddar and Parmesan cheeses until the mixture is velvety smooth. Season with salt, pepper, and a touch of nutmeg if desired.
Pour the rich cheese sauce over the sliced veggies in your bowl. Gently toss to ensure every piece is coated. Then, layer the veggies in your greased baking dish for an even distribution.
Cover the dish with foil and bake for 35-40 minutes. Remove the foil, sprinkle the remaining cheese on top, and return it to the oven for another 15-20 minutes until golden brown and bubbling.
Allow the gratin to cool slightly before serving. Garnish with fresh thyme leaves for a burst of color and extra flavor. Voilà, your cheesy root veggie masterpiece is ready to savor!