Cook the bacon in a large skillet over medium heat until crispy. Remove from pan and place on a paper towel lined plate to drain. Crumble when cooled.
Remove all but 1 tablespoon of bacon grease from the pan. Add the onions and sugar to the pan and cook over medium low heat for 10-15 minutes, stirring occasionally, or until onions have caramelized.
Remove the onions from the pan and refrigerate for 10 minutes to cool.
Meanwhile, place the pie crust in the tart pan. Gently press it into the pan and remove any excess dough.
In a large bowl combine 2/3 cup of cheese, eggs, and milk. Mix well. Add in the rosemary, marjoram, and pepper and stir until combined.
Sprinkle almost all of the bacon in the bottom of the tart pan. Spread the caramelized onions on top.
Pour the egg mixture on top of the bacon and onions. Sprinkle remaining cheese and bacon on top.
Bake for 30-35 minutes or until the top has browned and the egg is cooked through. Remove from the oven and cool for 15 minutes.
Carefully lift the bottom out of the tart and away from the sides. Cut the tart and serve warm.