Magnetic and electrical properties related to structural transitions in NaxVS2 and NaxVSe2