Preheat oven to 350°F. Grease a 9x9-inch (or 2-quart) baking dish with cooking spray and set aside.
Peel, wash, and slice the potatoes into thin ⅛-inch rounds (as thick as a nickel) using a mandoline or sharp knife.
Melt butter in a large pot over medium heat. Whisk in flour, garlic powder, onion powder, salt, and pepper. Cook, whisking constantly, for 1 minute. Gradually whisk in milk, a little at a time, until smooth with no lumps. Increase heat to medium-high and cook until the sauce thickens enough to coat the back of a spoon, about 4–6 minutes.
Remove from heat. Gradually stir in 1-1/2 cups Cheddar and 1/4 cup Parmesan, adding a small handful at a time. Stir gently after each addition until the cheese is melted and the sauce is smooth before adding more.
Add sliced potatoes and gently toss with a rubber spatula to coat evenly without breaking the slices. Pour the mixture into the prepared baking dish and smooth into an even layer.
Cover tightly with foil and bake for 1 hour and 15 minutes, or until the potatoes are fork-tender. Remove foil and sprinkle the remaining 1/2 cup Cheddar and 1/4 cup Parmesan evenly over the top.
Return to the oven, uncovered, for 15–20 minutes, until the top is golden and bubbling.
Optional: Move the oven rack to the upper-middle position and broil for 1 minute, watching very closely to prevent burning.
Video
Notes
Note 1: For a richer, more complex flavor, swap 1 cup cheddar for 1 cup freshly shredded Gruyère.Note 2: Use a block of Parmesan and grate it on the large holes of a grater. Gently pack it into the measuring cup for an accurate amount.Make Ahead: Bake as directed, keeping the foil on while it cools. Add the remaining cheese, cover tightly, and refrigerate. When ready to serve, let sit at room temperature for 1 hour, then bake covered at 350°F for 20–30 minutes, uncover, and bake another 10–15 minutes until hot and bubbly.Store Leftovers: Let cool, cover tightly, and refrigerate for up to 4 days. Reheat in the microwave or bake at 350°F until warmed through.