Thinly slice the garlic into paper-thin slivers and finely dice the onion. Preheat your oven to 400°F (200°C) so it is ready for the final baking stage.
Heat the olive oil in an oven-safe skillet over medium heat. Sauté the onions until they are soft and translucent, then add the garlic slivers for one minute. Once fragrant, stir in the tomato paste and let it fry for two minutes until it turns a deep red.
Pour in the crushed tomatoes, oregano, red pepper flakes, salt, and pepper. Use your spoon to scrape up any flavorful browned bits from the bottom of the skillet. Let the sauce simmer gently for about eight minutes.
Rinse and drain your cannellini beans, then gently stir them into the simmering tomato sauce. You want to coat every bean in the sauce without mashing them. If the sauce looks too thick to spread, add a tablespoon of water to loosen it slightly.
Turn off the heat and level out the bean mixture with your spoon. Cover the surface with a generous layer of shredded mozzarella and a final dusting of grated Parmesan. This dual-cheese layer is what gives the dish its top-notch, decadent finish.
Place the skillet in the oven and bake for 15 to 20 minutes. The dish is finished when the cheese is bubbling and has developed golden-brown spots. For a truly professional look, you can broil the top for the last 60 seconds. Let the pan rest for five minutes before serving with thick slices of toasted sourdough bread to soak up the sauce.