the mask is not really part of the image, outside of pixinsight. if you save what you're working on as a project then when you open the project again the mask will be there. but i'm not aware of any file format that could represent the mask. maybe, possibly, the alpha channel in some formats like TIFF could do this… but PI does not support that.
why do you want the mask on the image on disk? masks are usually used to limit what parts of the image particular PI processes are applied to. for instance you might want to protect the background with a mask while increasing the saturation of the foreground.
rob