The Republican candidate for governor in Virginia has tried to inject transgender issues into the election race.