Trim both ends off the onions then cut in half lengthways, peel, then lay each half flat and slice into ¼-inch thick half circles.
Heat 1 tablespoon of olive oil and 1 tablespoon of butter in a heavy bottomed skillet or Dutch oven over a medium heat and cook the onions for 10 minutes until softened.
Mix the salt through then lower the heat down to low and continue cooking for 40 minutes until golden and super soft. It needs to be stirred often so they don't catch and burn. Add a small splash of water if they are getting too dry. Set aside when done.
Boil your pasta in well salted boiling water, I usually undercook by 1 min from package instructions. Reserve a cup of pasta water before draining.
When the pasta only has about 5 minutes to go return the skillet you cooked the onions in to medium heat. Add the garlic (and red pepper flakes if using) and cook gently for 1 minute until fragrant, it shouldn’t brown at all.
Pour in the cream and bring to a very gentle simmer, lowering the heat if needed so it never boils. Stir in the thyme.
Add the parmesan in 2-3 additions, mixing well and letting it melt between each addition until the sauce is smooth.
Add the cooked pasta, caramelized onions, lemon juice and ¼ cup pasta water and toss well.
Let it gently bubble away for a minute or two over a low heat so the pasta finishes cooking and the sauce thickens, adding more pasta water if needed to loosen. It will thicken quickly off the heat so keep it on the saucy side in pan.
Check for seasoning and serve immediately with extra parmesan and grated lemon zest if desired.
