Preheat oven to 375°F and spray a 9×13-inch baking dish with cooking spray.
In a medium saucepan over low heat, melt the butter and cook the diced onion until softened, about 3-5 minutes. Add the flour, salt, and pepper, stirring constantly, and cook for 1 minute.
Slowly drizzle in the milk, whisking constantly. Continue cooking, whisking frequently, until the mixture thickens, about 5-8 minutes.
Remove from heat and stir in 1 cup of shredded cheese until melted and smooth, about 30 to 60 seconds. Set aside.
Arrange the sliced potatoes in the prepared baking dish, keeping the shape of each potato together and fanning them out into a single layer.
Pour the cheese sauce evenly over the potatoes, then sprinkle with the remaining cup of shredded cheese.
Cover with aluminum foil and bake for 60 minutes, or until the potatoes are fork-tender.
Remove the foil and broil for 2-3 minutes, watching carefully, until the top is golden brown.
Serve hot, garnished with parsley. Add salt and pepper to taste.