Preheat the oven to 375°F (190°C).
In a saucepan over medium heat, melt the butter. Once melted, whisk in the flour and cook for about 1 minute, stirring constantly until it turns a light golden color.
Gradually add the milk and heavy cream to the saucepan, whisking continuously to avoid lumps. Cook, stirring, until the mixture thickens slightly, about 5-7 minutes.
Stir in 2 cups of the cheddar cheese, garlic powder, onion powder, and season with salt and pepper. Remove from heat when cheese has fully melted and the sauce is smooth.
In the baking dish, layer half of the sliced potatoes, followed by half of the cheese sauce. Repeat with the remaining potatoes and finish with the rest of the cheese sauce over the top.
Sprinkle the remaining 1 cup of cheddar cheese and the Parmesan cheese over the top layer.
Cover the baking dish with aluminum foil and place it in the preheated oven. Bake for 45 minutes.
After 45 minutes, remove the foil and bake for an additional 15 minutes or until the top is golden brown and bubbling.
Let it cool for about 10 minutes before serving. Garnish with chopped parsley if desired.