Sauté vegetables: Heat the olive oil in a large pot or Dutch oven over medium heat. Add the chopped onion, diced carrots, and diced celery. Cook for 5-7 minutes, stirring occasionally, until softened.
Add garlic and spices: Stir in the minced garlic, dried thyme, dried rosemary, and red pepper flakes (if using). Cook for 1 minute more, until fragrant.
Deglaze with wine: Pour in the white wine and scrape up any browned bits from the bottom of the pot. Bring to a simmer and cook for a few minutes, until the wine has reduced slightly.
Add broth and beans: Add the vegetable broth (or chicken broth), cannellini beans, and Great Northern beans to the pot. Bring the mixture to a simmer, then reduce the heat to low and simmer, covered, for 20-25 minutes, stirring occasionally.
Add greens: Stir in the roughly chopped kale or spinach. Cook for a few minutes, until the greens have wilted.
Season and serve: Season the soup with salt and pepper to taste. Serve hot, garnished with a drizzle of olive oil, grated Parmesan cheese, and with crusty bread for dipping, if desired.