You have to save it to NBT.
Overwrite the writeToNBT method and save the NBTTagCompound resulting from the ItemStackHandler's serializeNBT method.
Overwrite the readToNBT method and load the data by getting the NBTTagCompound from the NBTTagCompound parameter and passing it into ItemStackHandler's deserializeNBT method.