FSFM: A Generalizable Face Security Foundation Model via Self-Supervised Facial Representation Learning