Melt the butter in a large saucepan over medium heat. Add the onions, then season with salt and cook until the onions are soft and very aromatic, 5 to 7 minutes. Add the garlic and cook for another 2 to 3 minutes. Whisk in the flour and cook until the roux is the consistency of wet sand, 3 to 4 minutes. Whisk in the milk, bring to a boil and cook for 5 to 6 minutes. Turn off the heat and whisk in the mustard and cheeses. Season with salt to taste to make sure it is delicious!
Place a quarter of the potatoes in the bottom of a 9-by-13-inch baking dish. Ladle a quarter of the cheese sauce evenly over the potatoes. Repeat this process 3 or 4 more times with the remaining potatoes and sauce, pushing down the potatoes between each layer and topping with the sauce. Place the baking dish on a sheet tray lined with foil. Bake, rotating the dish halfway through, until the potatoes are soft when poked with a fork, 50 to 60 minutes. Tent with foil if the top is getting too brown.