Make the Caramelized Onions: Heat the olive oil in a large sauté pan over medium-high heat until shimmering. Add the sliced onions and, using a metal spatula, stir to coat all of the onions with the olive oil. Reduce the temperature to medium and cook the onions, stirring and turning occasionally, not allowing them to burn, for 10 minutes. Sprinkle the onions with the kosher salt and sugar, and stir to evenly distribute. Reduce the temperature to medium-low and continue to cook, turning and stirring, scraping up any browning on the bottom of the pan, until the onions are a deep golden brown, 20 to 30 more minutes. Pour the beer into the pan and scrape up any browned bits that have collected on the bottom. Let the mixture simmer, stirring occasionally, until all of the beer has evaporated, 5 to 10 minutes. Remove from the heat.
Assemble the Dip: Preheat the oven to 375 degrees F. Using a fork, mash the roasted garlic into the cream cheese and sour cream until a smooth, homogenous mixture forms. Stir in the cheddar cheese, white and light green parts of the green onion, and the caramelized onions (reserving a bit for garnish, if desired).
Transfer the mixture to a small baking dish (I used a Le Creuset dish that's just over 1-quart in size) and bake until golden brown and bubbling, 20 to 25 minutes. Remove from the oven, garnish with the reserved caramelized onions and green onions. Serve with tortilla chips, bread or crackers. Leftovers can be stored in the refrigerator, covered with plastic wrap, for up to 3 days.