Preheat oven to 350 °F. Grease a 9 x 13 casserole dish with cooking spray.
Heat butter in a large skillet. Add onions and cook for 1 to 2 minutes. Add beef and cook till no longer pink. Remove from heat, drain excess fat and set aside.
Whisk in flour, salt, garlic powder and black pepper with milk and cream until totally combined. Set aside.
Using a mandolin (or kitchen knife), slice potatoes into ⅛-inch slices. Layer ⅓ of the potato slices in the casserole dish. Sprinkle on ⅓ of the beef mixture, then ⅓ of the cheeses, then pour on ⅓ of the cream and milk mixture.
Repeat this twice more, ending with a sprinkling of cheese and a pouring on of the rest of the cream mixture. Cover dish with foil and bake for 60 minutes. Remove the foil and bake for an additional 20 minutes or until potatoes are tender.