The thing that's helped me, more than anything else, has been refactoring.
Take a project (this can be a work project, personal project, open source project, whatever), and start refactoring.
Over time, the more you refactor other people's code, the better you'll "get into their head" and understand their way of thinking, whether good or bad.