You can fry the shallots 2 days ahead. Store at room temperature, very loosely covered with foil (if desired, re-crisp in oven before using). The green beans can be cooked 1 day ahead and stored, covered, in the refrigerator. The casserole can be assembled (minus the topping) 1 day ahead, and kept refrigerated, covered. Bring to room temperature before baking.