Melt butter in a large skillet or dutch oven over medium low heat. Add shallots and garlic and sauté for 5-6 minutes over medium heat.
Add spinach and stir well. Continue cooking spinach for another 5 minutes.
In a separate bowl, whisk together 1 cup of milk with ¼ cup of flour until there are no lumps left.
Pour in remaining milk, milk/flour mixture from the previous step, lemon juice, salt, pepper, nutmeg, and cayenne to the spinach and stir to combine.
Increase temperature to medium high and bring to a simmer, then reduce heat to medium and stir occasionally for 5 minutes.
Add in the mozzarella and half of the parmesan and continue cooking, stirring well, until the cheese is melted.