For me it was basically learning to take a text in a foreign language and parse it. When you're faced with a different word order and, by extension, a different way of thinking about things, you're forced to take each element of the sentence and break it down as far as you can, in order to understand what's going on.
For my second year of University, I studied in Germany (rather than Canada0, which made things really hard for me. To translate my Latin texts I translated from Latin to English and then worked out how to translate the English to German.
I had a really great professor who taught us not only how to break down words to find their meanings, but he also made no bones about the fact that the key to translating is knowing when to make a good guess.
Once you can get by with Greek and Latin, you can pick up a lot of other bits of languages fairly easily. Sometimes it's by knowing root words. Sometimes it's because you've gotten good at guessing.
A lot of those skills apply directly to reading someone else's code and trying to make sense of it. I find that if you can learn to decipher a foreign, natural language, you may just do alright with languages that machines understand.