A mix of both by ear and tabs.
When I'm listening to a song on my IPod which I like, I actually visualize myself playing it in my head, go home and remember how I visulaized myself playing it, and surprisingly, it sounds correct. Kind of crazy, I know, but it works.
Or if I'm in a hurry to...