In a large saucepan or skillet, melt the butter over medium heat. Add the onions to the pan and season with a generous pinch of salt. Cook the onions down, stirring occasionally until they begin to soften, about 10 minutes. Reduce heat to medium-low, and continue cooking, stirring occasionally, for 20 minutes or so.
After 20 minutes, the onions will deepen in color and require more frequent stirring. When the bottom of the pan begins to darken, add the 1/4 c of white wine, broth, or water and scrape the bottom. Taste for additional salt and continue cooking for 20-25 more minutes. When the onions are jammy--dark, and fragrant--remove from the heat and set aside.
Using a sharp knife, cut the Brie in half. Spread half of the onions onto one of the cheese rounds and top with the other round—reserve the remaining onions for garnish. Gently press the rounds together and set aside.
Preheat oven to 400 degrees F.
Roll out the puff pastry on a lightly floured surface so it is about 1/8’’ thick. Place the Brie in the center of the square and place a 10 1/2’’-11’’ bowl on top. Using a sharp pairing knife, cut around the edge to form a large circle. Remove excess puff pastry and brush the pastry with egg wash, then gently stretch the dough to cover the Brie. Place on a parchment-lined plate and freeze for about 30 minutes.
After Brie has chilled, transfer to a parchment-lined sheet and brush with the remaining egg wash. Bake the Brie for 18-20 minutes, or until puffed and golden—rotate 180 degrees halfway through baking.
Garnish with remaining onions and rosemary. Serve hot with crackers and cured meats.