Soak the beans, uncovered, in a large bowl of cold water for at least 4 hours, or up to overnight. Drain and set aside.
Arrange a rack in the lower third of your oven and preheat to 225°F.
Trim the leeks discarding the tough green tops, halve vertically, and rinse in cold water, making sure to clean out any dirt trapped between the layers. Slice into thin half circles. In a Dutch oven or ovenproof casserole over medium heat, warm the olive oil. Add the celery, garlic, and leeks and cook until the vegetables are softened, 3-5 minutes.
Add the beans, thyme, herbs de Provence, red pepper flakes to taste, 3/4 teaspoon salt, and a generous amount of black pepper. Stir in the vegetables broth and 1/2 cup water and bring the mixture back up to a gentle boil. Cover the pot with an ovenproof lid or cover tightly with foil. Place in the oven and cook, checking occasionally to make sure the pot is never dry, until the beans are soft throughout but not falling apart, 3 to 3 1/2 hours. If the pot seems dry, add water in 1/2 cup increments and stir once or twice. Taste and adjust the salt and pepper if necessary.
Remove the pot from the oven and turn the temperature to 500°F Sprinkle the mozzarella and Parmesan on top of the bean mixture and put the pot back in the oven, leaving the lid off. Cook until the cheese is completely melted and brown in spots, 8-10 minutes. Serve hot.