Preheat oven to 375°F. Spray a 9x13-baking dish with cooking spray and set aside.
Bring a large pot of salted water to a boil. Cook pasta until al dente. Use a colander to drain well. Drizzle pasta with a little olive oil and stir so it doesn’t stick together. Pour the pasta into a large bowl and set aside.
Meanwhile, in a large sauté pan, heat the oil over moderate heat. Add the Italian sausage and cook, breaking up the meat with a wooden spoon, until it is no longer pink, about 5 to 7 minutes. Discard the excess fat and set aside.
In a medium bowl, mix together the ricotta, egg, 1 cup mozzarella cheese, ½ cup Parmesan cheese, basil, Italian seasoning, and crushed red pepper flakes, if using. Season with salt and pepper.
Add the ricotta mixture to the pasta. Add the marinara sauce, cooked sausage, and stir until combined, stirring gently to not break up the pasta noodles.
Pour the pasta into the prepared pan and top with the remaining 1 cup mozzarella cheese and ¼ cup Parmesan cheese.
Bake for 25 to 30 minutes or until cheese is golden brown and the pasta is bubbly. Remove from the oven and let sit for 5 minutes. Garnish with fresh basil, if desired, and serve warm.