Preheat oven to 350°. Butter a 13x9" baking dish. Melt 6 Tbsp. unsalted butter in a medium saucepan over medium-high heat until foaming, about 2 minutes. Cook 1 small onion, finely chopped or coarsely grated, stirring often, until softened and translucent but without taking on any color, about 3 minutes. Sprinkle ¼ cup all-purpose flour over and stir until evenly distributed and no lumps remain. Pour in 2½ cups whole milk in a slow, steady stream, whisking constantly until combined. Bring to a simmer, still whisking constantly, and cook until béchamel is thickened to the consistency of a thin pudding, about 4 minutes. Transfer to a large bowl.
Add 1 cup sour cream, 2 tsp. Diamond Crystal or 1¼ tsp. Morton kosher salt, ½ tsp. freshly ground black pepper, and ¼ tsp. garlic powder, to béchamel and mix well. Add one 30-oz. package frozen shredded hash browns, thawed, and 2 cups coarsely grated cheddar and mix again to combine. Scrape mixture into prepared dish and spread into an even layer. Scatter remaining ½ cup coarsely grated cheddar over.
Bake hash brown casserole until golden brown on top and bubbling, 50–70 minutes. Let cool 5–10 minutes before serving.
