Preheat the oven to 350°F [180°C].
Heat 2 Tbsp extra-virgin olive oil over medium heat in a large cast-iron or stainless-steel skillet.
Add the leeks and shallots. Cook, flipping the leeks over with a pair of kitchen tongs, until fragrant, the leeks have softened, and the shallots are lightly browned, 3 to 4 minutes.
Add the garlic cut side down, adding more oil to the skillet if necessary. Cook until the garlic is fragrant and just starting to brown, about 1 minute. Remove from the heat and transfer the vegetables to an 8 by 6 by 2 in [20 by 15 by 5 cm] deep baking dish or loaf pan.
Add the lemon and tomatoes. Sprinkle with the red pepper flakes and saffron. Pour the 1 cup [240 ml] extra-virgin olive oil over the vegetables in the dish (add more if needed to cover). Cover the dish with aluminum foil and seal tightly all around. Place on a rimmed sheet pan (in case it bubbles over) and bake for about 1 hour. The leeks and garlic should be falling apart, and the shallots should be soft when done. Remove from the oven and let sit, covered, for 10 minutes before serving.
Sprinkle with a little flaky salt and serve warm with bread. Save leftover confit in the refrigerator. Warm to room temperature before serving as a dipping oil with bread. You can also make this a week in advance and store in an airtight container in the refrigerator. Warm it up in the oven at 300°F [150°C].
