Preheat an oven to 350 degrees F (175 degrees C). Grease a 9x13 inch baking dish.
Heat the olive oil in a large skillet over medium heat; cook and stir the shredded potato and onion in the hot oil until the potatoes begin to brown, about 5 minutes.. Season with salt and pepper. Add the asparagus and ham and continue cooking until the asparagus is tender, another 5 to 7 minutes; transfer to the prepared baking dish. Whisk the eggs and milk together in a small bowl; pour evenly over the dish. Scatter the mozzarella and white Cheddar cheeses over the top of the potato mixture.
Bake in the preheated oven until set in the middle, 20 to 25 minutes. Garnish with the basil to serve.