Preheat your oven to 375°F (190°C).
Cook the pasta according to package instructions until al dente. Drain and set aside.
In a large skillet, heat the olive oil over medium heat. Add the sliced onions and cook, stirring occasionally, until they are caramelized and golden brown, about 15-20 minutes.
Add the minced garlic, thyme, salt, and pepper to the skillet. Cook for an additional 2-3 minutes until fragrant.
Pour in the beef broth and heavy cream, stirring to combine. Bring the mixture to a simmer and let it cook for about 5 minutes, allowing it to thicken slightly.
In a large mixing bowl, combine the cooked pasta with the onion mixture. Stir in half of the Gruyère, all of the mozzarella, and half of the Parmesan cheese.
Transfer the pasta mixture to a greased 9x13-inch baking dish. Top with the remaining Gruyère and Parmesan cheese.
Bake in the preheated oven for 25-30 minutes, or until the cheese is bubbly and golden brown.
Remove from the oven and let it cool for a few minutes before serving. Garnish with fresh parsley.