Make the tomato sauce: add the whole peeled tomatoes to a large heavy-based pot, squash with a potato masher (or chop), add the halved white onion, 40–60 g butter, salt and pepper, then simmer gently for 45 minutes; remove and discard the onion.
Cook the spinach in a pan or pot until just wilted, drain well, let cool, then roughly chop and squeeze out excess water.
Heat 2 Tbsp olive oil in a large non-stick pan over low heat and gently soften the chopped red onion for about 5 minutes without browning.
Add 2 Tbsp butter and the minced garlic to the softened onions and cook for about 1 minute until fragrant.
Sprinkle in 2 Tbsp flour and stir to form a roux; cook briefly, then add the milk slowly while stirring until a thick béchamel forms, adding a little more milk if too thick and cooking until the raw flour taste is gone.
Stir the chopped spinach into the béchamel, season with salt, pepper and 1/4 tsp grated nutmeg, and cook until the mixture is a thick, paste-like consistency.
Remove from the heat and fold in 250 g ricotta and 3 Tbsp grated Parmesan until evenly combined; let the filling cool enough to handle.
Preheat the oven to 180°C (350°F). Spread a thin layer of the tomato sauce over the base of a baking dish and scatter shredded basil over it.
Fill a piping bag (or use a spoon) with the cooled spinach-ricotta filling and pipe or spoon the mixture into each cannelloni tube, sealing one end with your hand if needed; arrange the filled tubes snugly in the dish.
Pour the remaining tomato sauce over the tubes, tear or slice the mozzarella and distribute it across the top, then drizzle a little olive oil over the cheese.
Loosely cover the dish for the first 20 minutes of baking to prevent over-browning, then bake uncovered at 180°C (350°F) for a total of about 1 hour (remove cover after ~20 minutes) until golden and cooked through.
Rest the bake briefly, scatter fresh basil leaves over the top, and serve.