X-ray spectroscopy for the magnetic study of the van der Waals ferromagnet CrSiTe3 in the few- and monolayer limit