Set the oven to 350°F (175°C) and position an oven rack in the center.
Grate the sharp cheddar and Parmesan cheeses. Peel the potatoes, then use a mandoline slicer to cut them into uniform slices approximately 1/8 inch (3 mm) thick. Russet potatoes may be used as listed, while Yukon Gold potatoes are also noted as an option for a more buttery flavor and pleasing texture.
Place the butter in a small saucepan over medium-high heat and allow it to melt.
Add the freshly minced garlic and sauté for approximately 30 seconds, just until aromatic.
Pour in the heavy cream, stir in the salt, and season with black pepper as desired.
Heat the cream mixture while stirring from time to time. As soon as it begins to reach a boil, remove the saucepan from the heat immediately to help prevent the cream from curdling.
Lightly coat a 9 × 13-inch baking dish with grease.
Arrange half of the sliced potatoes across the bottom, allowing the slices to overlap slightly. The arrangement does not need to be perfectly uniform.
Drizzle half of the warm garlic cream sauce evenly over the first potato layer. Scatter half of the shredded cheddar and half of the grated Parmesan over the cream.
Add the remaining potato slices in a second layer. Pour over the rest of the garlic cream mixture, then distribute the remaining cheddar and Parmesan evenly across the top.
Cover the baking dish securely with aluminum foil and transfer it to the preheated oven.
Bake the covered potatoes for 40 minutes.
Carefully remove the foil, then return the uncovered dish to the oven for an additional 25 to 35 minutes. The scalloped potatoes are ready when the slices can be easily pierced with a toothpick and the cheese topping is golden, melted, and bubbling.
Take the finished potato gratin from the oven and allow it to stand for 5 to 10 minutes before serving. This brief resting period gives the layers time to settle and helps the portions hold their shape when cut.