It comes with practice, I believe. Cracking problems from past years' examinations helps, but it takes a lot of discipline to do these extra preparations.
Once you are au fait with the concepts behind a question, you'll realise that there are a limited number of twists to any situation. However, identifying which theories to use can be pretty challenging.
I am always caught off guard when a problem requires the application of equations from various disciplines (e.g. Kinematics + Quantum Physics)
