Preheat oven to 375°F. Grease a 9 x 13-inch baking pan and set aside.
Bring a medium-large pot of water to boil. Place the potatoes into the boiling water whole and unpeeled for 10 minutes.
While the potatoes are boiling, melt butter, onion and garlic in a saucepan over medium heat. Whisk in the flour until well-combined, and then add in milk. Stir often for about 2-3 minutes. Reduce the heat to simmer and stir in cheddar cheese, salt and pepper. Whisk until well mixed.
Remove the par-boiled potatoes from the pot and let it cool slightly so that you can peel. Cut into 1/8-inch thick slices.
Place half of the sliced potatoes in an even layer in the baking dish and top with 1 layer of sliced ham. Spoon about half of the cheese sauce and spread it evenly on top. Repeat layers ending with cheese sauce, and then top with mozzarella cheese. Cover with aluminum foil.
Bake for about 20 minutes to cook the dish thoroughly, then remove the foil and broil on high for about 3 to 5 minutes or until the cheese turns golden brown and sizzling.
Transfer the dish to a cooling rack.
Sprinkle with chopped parsley. Serve warm and enjoy!