In a large pot of salted boiling water, cook the pasta until al dente according to the package instructions. Drain and set aside, reserving about 1 cup of pasta water.
In a large skillet, heat the olive oil over medium heat. Add the minced garlic and sauté until fragrant, about 1 minute.
Pour in the crushed tomatoes, season with salt, pepper, and red pepper flakes. Stir and let it simmer for about 10-15 minutes until it thickens slightly.
Add the cooked pasta to the skillet with the sauce. Stir to coat the pasta evenly, adding some of the reserved pasta water if necessary for a creamier consistency.
Mix in the cubed mozzarella and half of the grated Parmesan into the pasta, allowing the cheese to melt slightly.
Pour the pasta mixture into a baking dish and sprinkle the remaining grated Parmesan cheese on top.
Preheat the oven to 180°C (350°F) and bake for about 20 minutes, until bubbly and golden on top.
Once out of the oven, let it rest for a few minutes. Garnish with fresh basil leaves before serving.