Preheat oven to 375°F. Spray a 9×13-inch baking dish with cooking spray. Set aside.
In a medium saucepan over medium heat, melt butter. Whisk in the flour, salt, and pepper. Cook for 1 minute.
Slowly drizzle in milk, whisking constantly. Continue cooking until the mixture thickens, 5-8 minutes, whisking frequently.
Remove from heat. Stir in 1 cup of cheese. Continue stirring until the cheese is melted and smooth, about 30 to 60 seconds. Set aside.
Carefully set the potato slices in the bottom of the prepared baking dish (trying to keep the shape of the potato together), and fan them out in a single layer.
Top the potatoes with the cheese sauce and the remaining cup of shredded cheese.
Cover with aluminum foil and bake for 50 minutes.
After 50 minutes, remove foil and continue to bake for an additional 10 minutes, or until potatoes are fork-tender.
While the potatoes are baking, prepare the fried onions.