One way is to head north and pick up the Northern Tier to Whitefish, MT. Then due south thru Seeley Lake. Not the most direct, but very scenic.
If you take this route, spend the extra time to go to Glacier and spend at least one night. It is so magnificent that you'll kick yourself for being that close and not seeing it if you pass it up.
I've wondered if it wouldn't have been smarter for us (going the other way) to head northwest from Yellowstone to the east side of Glacier. The TA seems to spend a lot of time riding in "W"s down in SW Montana, and the scenery is good but not all that great (IMHO).