Preheat oven to 400F degrees. Line a rimmed baking sheet with foil. Grease shallow 2-quart oval baking dish or a 11x13 glass rectangle dish. Set aside.
In a large bowl, combine Cheddar and pepper jack cheeses; transfer about 1 cup to a small bowl and set aside for topping later. To the large bowl with cheeses, add heavy cream, garlic, rosemary, salt and pepper, stir lightly.
Very thinly slice the potatoes; place in bowl with the cream and cheese mixture. With hands or large spoon, toss until all slices are well coated. Arrange slices in baking dish, sides facing up. If using oval bowl, arrange slices around outer edge and then fill center. If using 11-x13-inch rectangle, arrange slices in rows. After all potato slices are arranged, place the onion slices intermittently throughout the potatoes.
Cover baking dish tightly with foil, place on lined baking sheet and bake for 30 minutes. Remove foil, bake for additional 30 minutes. Sprinkle reserved cheese over top of potatoes, adding extra if you like, bake for final 30 minutes. Check potatoes with a fork and if needed, tent foil back on dish and turn off oven. Let potatoes remain and continue to soften in the warm oven for up to 20 minutes more.
Sprinkle with extra rosemary if desired and serve.