Late September and October genuinely nail that balance - you get the tail end of decent weather with a huge drop in visitors once Labor Day passes. The reason fall works so well is that most families are back in school by then, so the parks shift from chaotic to actually manageable. Yellowstone especially becomes way more pleasant; the geysers still perform, hiking trails aren't shoulder-to-shoulder, and you might even catch elk bugling season if you time it right in early fall.
That said, don't sleep on May or early June for spring. Yeah, there's some rain depending on the park, but the crowds haven't exploded yet and wildflowers are popping off. The Grand Canyon in spring is genuinely beautiful - less oppressive heat than summer, better for day hikes. Just know that some higher elevation areas might still have snow lingering in late May, so check park websites closer to your trip for trail conditions.
One thing people don't always consider: shoulder season in fall can mean some facilities start closing by October, so if you need lodging or specific amenities, book early and confirm what's actually open. But if you're flexible and camping or staying outside the parks, you've got way more freedom to avoid the madness.