Heat the bacon in a large pot or Dutch oven over medium-high heat until lightly browned and tender. Add 1 onion (chopped) and saute' until tender, 6 to 8 minutes. Add the garlic and saute' a few more minutes.
Add the green beans and enough broth or water to just cover, bring to a boil, reduce the heat to low, and simmer, covered for 25 to 35 minutes, until beans are tender and have melted into the cooking liquid. Season the beans generously with salt and pepper.
Strain the cooking liquid from the beans and reserve (you should have about 2 1/2 cups).
Preheat the oven to 350 degrees.
Melt the butter in a large skillet over medium-low heat. Add the rest of the chopped onion, salt, and nutmeg and cook, stirring, until very soft, 6 to 8 minutes. Add the flour and stir until incorporated.
Stir in the cream and reserved bean cooking liquid and cook, stirring, until the sauce is thick enough to fall slowly from a spoon, 5 to 7 minutes.
Stir in the cheese, then add green beans and toss until combined.
Transfer mixture to 9X13 baking dish and bake until casserole is hot and bubbly around edges, about 25 minutes. Top with fried onions and cook an additional 10 - 15 minutes.
Remove from oven and cool slightly before serving.