Heat the oven to 375°F and butter a 9-by-13-inch baking dish. Peel or scrub the potatoes and slice them 1/8 inch thick; a mandoline is fastest.
Melt the butter in a large saucepan over medium heat. Add the onion and cook, stirring, 5 minutes until soft. Add the garlic and cook 30 seconds, then sprinkle in the flour and whisk for 1 minute.
Whisk in the milk and broth and simmer 3 to 4 minutes, whisking, until slightly thickened. Take the pan off the heat and stir in 1 cup of the cheddar, the salt and the pepper.
Layer half the potatoes in the baking dish, pour over half the sauce, then repeat with the remaining potatoes and sauce.
Cover tightly with foil and bake 40 minutes. Uncover, scatter the remaining 1/2 cup cheddar and the Parmesan on top, and bake 20 to 25 minutes more, until the potatoes are tender and the top is golden.
Rest 10 minutes before serving. To make ahead, assemble through step 4, cover and refrigerate up to 24 hours, then add 10 minutes to the covered bake.