3 TBSP butter
1 small yellow onion, peeled and thinly sliced
4 large garlic cloves, minced
1/4 cup flour
1 cup chicken stock 
2 cups milk (2% or whole milk)
1 1/2 tsp salt
1/2 tsp black pepper
2 tsp fresh thyme leaves, divided
4 lbs Yukon Gold Potatoes, sliced into 1/8-inch rounds
2 cups sharp cheddar cheese, divided (can add more cheese if you’d like)
1/2 cup Parmesan cheese, plus extra for serving

Preheat oven to 400 degrees F. Spray a 9 x 13″ baking dish with cooking spray; set aside.
Melt butter in a large sauté pan over medium-high heat. Add onion, and sauté for 4-5 minutes until soft and translucent. Add garlic and sauté for an additional 1-2 minutes until fragrant. 

Stir in the flour until it is evenly combined, and cook for 1 more minute.

Gradually pour in the stock, and whisk until combined.

Add in the milk, salt, pepper, and 1 teaspoon thyme, and whisk until combined.

Continue cooking for an additional 1-2 minutes until the sauce just barely begins to simmer around the edges of the pan (avoid letting it come to a boil) and thickens. Then remove from heat and set aside.

Spread half of the sliced potatoes in an even layer on the bottom of the pan.

Strain out the onion mix. Then top the potatoes evenly with half of the cream sauce. Add the onions in a layer.

Then sprinkle evenly with 1 cup of the shredded cheddar cheese, and all of the Parmesan cheese.

Top evenly with the remaining sliced potatoes, the other half of the cream sauce, and the remaining 1 cup of cheddar cheese. ***At this point, if making the potatoes in advance (like I am), cover and refrigerate. When ready to serve, bring to room temperature, and then follow the remaining directions.

Cover the pan with aluminum foil and bake for 30 minutes. The sauce should be nice and bubbly around the edges. Then remove the foil and bake uncovered for 25-30 minutes, or until the potatoes are cooked through.
Transfer the pan to a cooling rack, and sprinkle with the remaining teaspoon of thyme and extra Parmesan. Serve warm.