Cook bacon until crisp and rendered. Drain the bacon on a paper towel and discard the fat. Wipe out the bacon pot and heat the oil. Sauté the onions until golden brown. Add the garlic, thyme, rosemary and a pinch of salt and pepper. Continue to cook until well caramelized.