unsalted butter, divided
small yellow onion, chopped
garlic cloves, chopped
all-purpose flour
heavy cream
kosher salt
chopped fresh thyme, plus more for garnish
black pepper, plus more for garnish
sharp white Cheddar cheese, shredded
Gruyere cheese, shredded
Russet potatoes (about 4 large potatoes), peeled
Nonstick cooking spray