Preheat the oven to 180°C (350°F). Lightly oil two oven trays or line with baking paper.
Arrange the eggplant slices in a single layer on the trays, drizzle with 1 tablespoon olive oil and sprinkle with 1/2 teaspoon salt; toss to coat.
Roast the eggplant for 20 minutes, turning once after 10 minutes, until tender and golden. Remove and set aside to cool.
While the eggplant roasts, heat 1 tablespoon olive oil in a saucepan over medium heat. Add the chopped onion and cook 4–5 minutes until softened and lightly golden.
Add the sliced beef sausages and cook until browned and cooked through. Stir in the crushed garlic and cook until fragrant, about 30 seconds.
Pour in the crushed tomatoes, bring to a simmer, then reduce heat to low and cook for about 10 minutes until the sauce thickens.
Season the sauce with salt to taste, a pinch of sugar, 1 teaspoon vegetable stock powder, and 1/2 cup chopped basil; stir to combine and remove from heat.
In a bowl, combine the ricotta (or mascarpone) with 4 tablespoons basil pesto and salt and pepper to taste; mix until smooth.
Grease a 20cm square, 6cm deep ovenproof dish. Spread one third of the tomato-sausage sauce over the base.
Layer roasted eggplant slices over the sauce, then sprinkle with one third of the combined mozzarella and Parmesan.
Repeat with another layer of sauce, eggplant and mozzarella. For the next layer, add eggplant, sauce and half of the ricotta-pesto mixture.
Finish with the remaining sauce and ricotta mixture on top, then sprinkle with the remaining mozzarella and Parmesan.
Bake in the preheated oven for about 20 minutes, until the cheese is golden and bubbling. Let rest a few minutes before serving.