Very carefully, using a mandolin, slice the potatoes. they should be about 2mm thick.
Heat the oven to 375F. Grease a 9x13 baking dish.
Now begin your layers. Lay potato slices on the bottom of the dish in rows, overlapping the pieces slightly. "Sprinkle" (kind of spread and place) about 2Tbsps of the onion mix over the potatoes. Season the layer with salt and pepper, as well as a bit of thyme. Sprinkle over about 1Tbsp of flour, and 1/4 of the Cheese. Then repeat with more potatoes, onions, spices, flour and cheese for each layer until you are left with a top layer of potatoes.
Carefully pour the buttermilk over the whole thing. The buttermilk will combine with the flour and the starch from the potatoes to create a thick sauciness.
Cover with tin foil, and bake for 1 hour. After 1 hour, remove tin foil and test doneness. The potatoes should be nice and soft, and it should all be bubbling. Sprinkle the whole top with the Parmesan and put back in the oven for ~20 minutes.
Once its golden brown, and bubbling happily it's done. Allow to cool slightly before serving. Enjoy as a main, or alongside salad or protein or both.