Heat 2 tablespoons oil in a large pot over medium heat. Add onion, carrot and celery and cook, stirring occasionally, until the vegetables are soft, 4 to 6 minutes. Add garlic, thyme and rosemary; cook, stirring, until fragrant, about 30 seconds. Add kale; cook, stirring often, until tender and wilted, 3 to 5 minutes. Sprinkle with 1/4 cup flour and cook, stirring, for 30 seconds. Stir in broth, increase heat to high and bring to a boil. Reduce heat to a simmer and cook, stirring, until thickened, about 2 minutes. Stir in beans and 1/2 teaspoon each salt and pepper. Transfer the mixture to the prepared pan.