A good mix of both. This may sounds obvious but most of the time, the root you play the most in a tune or the one you come back the most often is usually the key of the tune. I know there can be exceptions to this rule but most of the time it's gonna work. SB
get the sound of the V chord in your head. The V will usually resolve to the I. That's what I rely on the most.
In an unfamiliar piece without a sheet, the "tonal center" of a progression is my best indicator. By experimenting with different notes in the progression, I'll get a feel for which modes work and which ones don't. Once the modes lock with the tune, I know I'm there, gain a bit of confidence and can go with it some.