Preheat the oven to 357 degrees. In a cake pan, drizzle garlic with oil. Cover with foil and roast for 40 minutes, until tender. Let cool, then squeeze out cloves. Mash the garlic to a paste and transfer to saucepan.
Add half-and-half, thyme, and rosemary. Bring to a boil and simmer over very low heat until reduced to 3 cups, approximately 20 minutes; season with salt and pepper.
Arrange 1/4 of the potatoes in the bottom of a 9x13 baking dish. Top with 1/4 of the grated cheeses and drizzle lightly with the garlic cream.
Repeat layering in the same way with the rest of the ingredients. Pour any remaining cream on top and press top layer of potatoes to submerge.
Bake gratin for about 1-1/2 hours, until golden and bubbling. Let cool twenty minutes before cutting into squares and serving.