Put the peeled garlic in a small pan and cover with water. Bring to a simmer and cook for 3 minutes.
Drain the blanched garlic, wipe out the pan and add the olive oil and red pepper flakes if using. Fry the garlic over high heat until it begins to take on some color, 2 minutes or so.
Add the water and vinegar. Reduce the heat and simmer for 10 minutes. Then add the sugar, rosemary and thyme. Season with salt and continue to cook for another 10 minutes or so until most of the liquid has evaporated and the cloves are coated.
Preheat the oven to 350°F/180°C and assemble the tart
Roll out the pie crust to fit your tart pan (I used a round cake pan and was happy to eat the extra crust)
Beat the eggs together with the half and half and sour cream. Season with salt and pepper.
Crumble the goat cheese into the pie pan and spread evenly. Distribute the caramelized garlic over top along with half of the shredded Gouda.
Pour over the custard and rearrange the garlic cloves as necessary. Top with the remaining cheese.
Place the tart in the oven and reduce the heat to 325°F/165°C. Bake for 40 minutes or until the filling has set and the top is a nice color. (Start checking around 30 minutes)
Remove from the oven and allow to cool briefly before serving.