Using a mandolin, slice the sweet potato. Arrange a layer of sweet potatoes in the bottom of a baking dish.
Heat the olive oil in a medium pan over medium heat. Add the onion and sauté for 3–4 minutes, until softened. Add the garlic and sauté for 1–2 minutes, until fragrant.
Add the flour and cook until the vegetables are well coated. Pour in the stock and whisk to incorporate. Pour in the milk and season with the salt, pepper, and half of the thyme. Simmer for 1–2 minutes, until thickened slightly. Remove the pan from the heat.
Pour half of the cream sauce over the layer of sweet potatoes in the baking dish. Top with 1 cup cheddar cheese and the Parmesan. Add another layer of potatoes, then top with the remaining cream sauce and cheddar cheese.
Cover the baking dish with aluminum foil and bake for 20 minutes.
Carefully remove and allow to cool for 5-10 minutes.
Serve the scalloped sweet potatoes warm, garnished with the remaining thyme.