Your keyboard would need to have this option built in. It could be in the form of a pedal jack on the keyboard that can be set for different functions, and the ability to advance through a list of registrations with each press of the pedal would need to be one of those selectable functions. If your keyboard does have this function, then your sustain pedal may or may not work with it. You would need to check the owner's manual of the keyboard to see what pedals are compatible with it.
Let us know what keyboard you have, and one of us may be able to tell you if it has this function.