Prep: Preheat the oven to 375°F (190°C). Lightly grease a 9×13-inch baking dish. Bring a large pot of salted water to a boil.
Cook the pasta: Cook the ziti 2 minutes less than the package directions (it will finish in the oven). Drain and set aside.
Brown the sausage: Meanwhile, heat the olive oil in a large skillet over medium-high heat. Add the onion and cook 3 minutes until softened. Add the garlic and sausage; cook, breaking it up, until browned, about 6-8 minutes. Drain any excess fat.
Make the sauce: Stir the marinara, Italian seasoning, salt, and pepper into the sausage. Simmer 5 minutes.
Mix the ricotta: In a medium bowl, stir together the ricotta, egg, 1/4 cup parmesan, basil or parsley, and 1 cup of the mozzarella until smooth. The egg is the secret — it keeps the ricotta creamy, not grainy, as it bakes.
Assemble: Spread 1 cup of sauce in the baking dish. Add half the pasta, dollop with half the ricotta mixture, and sprinkle with 1 cup mozzarella. Repeat with remaining pasta, ricotta, and 1 more cup mozzarella. Spoon the remaining sauce over the top and finish with the last cup of mozzarella and 1/4 cup parmesan.
Bake: Cover with foil and bake 20 minutes. Uncover and bake 10-15 minutes more, until the cheese is melted, bubbly, and lightly golden.
Rest and serve: Let the ziti rest 10 minutes (this helps it set for cleaner servings). Garnish with fresh basil and serve.