Preheat oven to 375°F. Grease a 9x13-inch or bigger baking dish and set aside.
Cook the spaghetti (break the noodles in half if preferred) according to the package instructions until al dente. Drain and set aside.
In a large skillet, cook the ground beef or Italian sausage over medium heat, breaking it apart with a spoon as it cooks. Once mostly browned, add the chopped onion and cook until soft and translucent. Add minced garlic and cook for 1 minute more.
Pour in the crushed tomatoes, tomato sauce, and heavy cream. Add dried basil, dried oregano, dried thyme, salt, and pepper. Stir well to combine. Allow the sauce to simmer for about 5-10 minutes, letting the flavors meld together.
Add the cooked spaghetti to the skillet with the creamy sausage mixture. Toss everything together with tongs until the spaghetti is evenly coated with the creamy sauce.
Transfer half of the spaghetti mixture to the greased baking dish. Layer half of the mozzarella, ricotta, and Parmesan cheeses over the spaghetti.
Add the remaining spaghetti on top of the cheese layer. Pour the rest of the sauce as well. Evenly spread or sprinkle the remaining mozzarella, ricotta, and Parmesan cheeses over the top.
Bake for about 25-30 minutes, or until the cheese is melted and bubbly, and the edges are golden brown.
Remove from the oven and let it cool for a few minutes. Garnish with fresh basil or parsley if desired. Slice and serve warm.