The sauce--in a saucepan, melt butter over medium heat; add onion and garlic; saute until tender.
Stir in flour, salt, and pepper; add milk all at once.
Cook/stir until thickened and bubbly; stir in ham; remove from heat.
Put half the sliced potatoes in a greased 1 1/2 quart casserole dish; top with half the sauce.
Sprinkle with smoked Gouda and cheddar cheese; add remaining potatoes and sauce.
Cover dish with foil; bake 35 minutes; uncover and bake for 30-35 minutes or until potatoes are tender and golden; sprinkle with Parmesan; bake 5 minutes or until cheese is golden; let stand 15 minutes before serving.