Metal-insulator transition and the anomalous Hall effect in the layered magnetic materials VS2 and VSe2