Put 2 tablespoons of butter in a large skillet over medium-low heat. When the butter melts, add the onions, season with salt and pepper, and cook until thick and dark brown, 1 to 3 hours.
Combine the flour, sugar, yeast, and salt in a bowl. Knead the dough until smooth and elastic, about 10 minutes. Let the dough rise for 1 hour.
Heat the oven to 350°F. Whisk the eggs and egg yolks in a bowl. Add the milk, cream, salt, and black pepper. Whisk to combine.
Roll out the dough and transfer it to a pie plate. Spread the onions on the crust, then pour the egg mixture over the onions. Bake until the quiche is set.
Let the quiche cool before slicing and serving.
