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 frequently, for about 15-20 minutes until they are caramelized and golden brown.
Stir in the minced garlic, sugar, salt, black pepper, thyme, and red pepper flakes (if using). Cook for an additional 2 minutes until fragrant.
Pour in the beef broth and Worcestershire sauce, bringing the mixture to a simmer. Let it cook for about 5 minutes to allow the flavors to meld.
Reduce the heat to low and stir in the heavy cream, Gruyère cheese, and Parmesan cheese until melted and creamy.
Add the cooked pasta to the sauce, tossing to coat evenly. Cook for an additional 2-3 minutes until heated through.
Serve immediately, garnished with fresh parsley.