Preheat oven to 350. Arrange garlic cloves in glass baking dish. Drizzle with oil. Cover and bake until garlic is very tender, about 40 minutes for elephant garlic or 30 minutes for regular garlic. Transfer garlic to rack and cool.
Melt butter in heavy large skillet over medium heat. Add onion and saute until tender and beginning to brown, about 15 minutes. Add brown sugar; stir until melted. Remove from heat and cool. Arrange onion mixture on bottom of 8x8-inch glass baking dish. Sprinkle cheese over. Arrange roasted garlic atop cheese. (Can be prepared 1 day ahead. Cover and chill.)
Preheat oven to 350. Bake garlic mixture until cheese melts but mixture is not bubbling, about 20 minutes. Add balsamic vinegar; stir until well blended. Season to taste with salt and pepper. Transfer mixture to medium bowl. Sprinkle with basil. Serve warm or at room temperature with baguette slices.