Heat the oven to 375℉. Lightly coat a 9x13-inch baking dish with olive oil.
Heat 2 tablespoons olive oil in a large high-sided skillet over medium-high heat until shimmering. Add 1 cup finely diced yellow onion, ½ cup peeled and finely diced carrots, ½ cup finely diced celery, 1 teaspoon of the kosher salt, and ½ teaspoon of the black pepper. Cook, stirring occasionally, until the vegetables are softened, 8 to 10 minutes. Stir in 3 minced garlic cloves and cook until fragrant, about 1 minute.
Add 1 pound ground beef, 1 pound mild Italian sausage, the remaining 1 teaspoon kosher salt, and remaining ½ teaspoon black pepper. Cook, breaking up the meat with a wooden spoon into small pieces, until the meat is cooked through, 8 to 10 minutes.
Turn off the heat. Push everything to one side of the skillet. Tilt the skillet toward the opposite direction so the fat pools, then scoop off the fat into a small heatproof bowl. Return 1 tablespoon of the fat to the skillet.
Return the skillet to medium-high heat. Stir in 2 tablespoons tomato paste and cook until slightly darkened in color, about 2 minutes. Stir in 1 (28-ounce) can tomato purée, 1 teaspoon Italian seasoning, and ¼ teaspoon red pepper flakes if using. Return to a simmer. Reduce the heat to low and let simmer for about 5 minutes. Turn off the heat. Taste and season with more kosher salt as needed.
Bring a large pot of heavily salted water to a boil over medium-high heat. Add 1 pound dried spaghetti and cook according to package instructions for 1 minute less than al dente.
Meanwhile, beat 1 large egg in a medium bowl until broken up. Stir in 16 ounces ricotta cheese, 4 ounces of the shredded mozzarella cheese, ½ cup finely grated Parmesan cheese, 2 tablespoons finely chopped fresh basil leaves, 2 tablespoons finely chopped fresh parsley leaves, and 1 teaspoon kosher salt.
When the pasta is ready, drain. Place 3 tablespoons unsalted butter in the now-empty pot (no need to clean) and let sit until the residual heat melts the butter. Add the pasta and toss to combine.
Add ½ cup of the Bolognese sauce to the pasta and toss to combine. Transfer half of the pasta mixture to the baking dish and spread into an even layer.
Top with about half of the remaining Bolognese sauce (about 3 cups) and spread into an even layer. Dollop half of the cheese mixture (about 1 ½ cups) over the sauce and spread into an even layer.
Repeat layering the remaining pasta mixture, Bolognese sauce, and cheese mixture. Sprinkle the remaining 4 ounces shredded mozzarella evenly over the top.
Bake until the cheese is golden brown in spots and melted, about 35 minutes. Garnish with more chopped basil and parsley. Let cool for about 5 minutes before cutting into squares like lasagna and serving.
