Preheat oven to 400 degrees and spray a 9x9 casserole dish with cooking spray.
Slice potatoes into thin slices, about ⅛ of an inch. Place half of the potatoes into the bottom of the casserole dish, in overlapping layers. Set the other half of the potatoes to the side.
Heat a medium sized saucepan over medium high heat.
Once heated, add the margarine and allow it to melt. Add in the diced onions and minced garlic and allow them to cook for about 3-5 minutes, until softened. Add in the seasonings and stir to combine.
Bring the heat down to medium / low medium and add in the arrowroot powder, stirring to combine.
Add in the milk, little by little and vigorously whisk together until all the milk is combined and there are no clumps.
Bring milk up to a slight simmer, stirring occasionally. Add in ¾ cup of mozzarella cheese (reserving ¼ cup) and the cheddar cheese. Stirring until the cheese is melted.
Add half the cheese sauce to the tops of the potatoes in the casserole dish.
Arrange the remaining potatoes over the cheese sauce in the casserole dish. Top with the remaining cheese sauce. Sprinkle the remaining mozzarella cheese over the potatoes.
Bake for 60 minutes, or until potatoes are softened to your liking. Cut into 9 pieces (3 inch by 3 inch squares) and serve.