How can I configure the buttons and rotary controls on the M32 to work with GarageBand on an iPad or iPhone?
You can't. The buttons and encoder are only open for NKS integration with KK and Maschine, they cannot even be accessed for MIDI functions in any software. You can bet it has been asked for these to be made available for MIDI mapping however, that is unlikely to ever happen. All you can access is the 8 encoders and the Pitch/Mod, it is a very basic and close to useless keyboard when not running via the KK software
The 4 encoders are mapped to CC14 to CC21 and you can't change that of you use the keyboard as a class compliant device, of course the keys will also work.