You need to set it up in your sf2 file or AUPreset, if you use those. For AUPresets, here's Apple's Tech Note TN2283:
Looping is specified using a Region List property (kAudioFilePropertyRegionList) describing a segment of looped audio data and can be set with the AudioFileSetProperty API.
Here's a long tutorial on using Garageband to set up a looping AUSampler. AU Lab also can generate AUPresets.
For sf2, a youtube video showing how to set up looping. Not clear what software he is using. If you are feeling adventurous, you could try building the open source Swami for OSX