Heat the olive oil in a heavy bottom pot over medium heat. Add the diced onion and sauté until it becomes translucent and fragrant, about 3-4 minutes.
Add the ground beef or sausage to the pot, breaking it apart with a spoon, and cook until browned and cooked through, about 5-7 minutes. Drain excess fat if necessary.
Stir in the minced garlic, dried basil, and red pepper flakes. Cook for about 30 seconds until the garlic is fragrant, making sure not to burn it.
Add the uncooked pasta directly into the simmering broth. Stir well, reduce heat to medium-low, and cook uncovered until the pasta is al dente, about 10 minutes, stirring occasionally to prevent sticking.
Once the pasta is cooked, stir in the shredded mozzarella and grated Parmesan cheese. Continue to cook until the cheese melts and the soup becomes creamy and slightly thickened, about 2-3 minutes.
Season with salt and pepper to taste, then give the soup a final stir. Serve hot, garnished with extra cheese or fresh herbs if desired.