They're a few methods of performing nutmegs:
1.) Turn in the opposite direction to which you're going when an opposing player is behind you. One of the more riskier (less succes rate) methods.
2.) When travelling at normal speed, press R2 and in a diagonal direction to change speed and direction quickly. The player tends to hit the ball a bit further from his feet making it perfect for performing nutmegs. One of the most satisfying methods and one I've mastered.
3.) Do the automatic (continuous) sidestep and press forward just as the defender is nearing towards you. One of the easiest methods, in theory. Hard to pull off, though.