Separate the "neck" of the butternut from the rotund body. Slice both sections in half lengthwise and then into slices 1 inch thick. Remove the seeds and membrane from the body and slice into half-moons 1 inch thick. Arrange the squash across two sheet pans, drizzle with olive oil and season with salt and pepper. Roast for 20 minutes, switching racks halfway through. Remove from the oven and set aside.
Heat a large saucepan over medium-high heat. Add 2 tablespoons of olive oil, the diced onion, and cook for 2 minutes until softened. Then add the garlic, tomato paste and red pepper flakes and cook for 2 minutes longer.
Pour in the crushed tomatoes, vegetable stock, 1 teaspoon of sea salt and the sugar, cover with a lid and simmer over medium heat for 10 minutes.
Combine the ricotta and grated cheese in a bowl. Season with sea salt and black pepper.
Spread a little of the tomato sauce in a baking dish. Start layering: place one third of the squash slices on the tomato sauce, add one third of the ricotta mixture, then add one third of the remaining sauce and top with one-third of the mozzarella. Repeat these layers two more times. You should finish with a layer of mozzarella.
Bake for 30-40 minutes, until the mozzarella is golden and the sauce is bubbling around the edges. Allow to cool for 10 minutes before serving.
Serve topped with torn basil leaves and extra grated cheese.