Preheat your oven to 180°C (350°F).
Cook the spaghetti according to the package instructions, then drain and set aside.
In a large skillet over medium heat, cook the ground beef until browned. Add the chopped onion and minced garlic, and sauté until the onion is translucent.
Stir in the tomato sauce, oregano, and basil. Let the sauce simmer for about 10 minutes.
Combine the cooked spaghetti with the sauce, then transfer the mixture into a baking dish.
Top with shredded mozzarella cheese and bake in the preheated oven for 20-25 minutes or until the cheese is bubbly and golden brown.
Let cool for a few minutes before serving.