Had a similar issue crop up on my VTX 1300 a couple years back in Idaho at the end of a two-week road trip. Riding at dusk and headlight was going off and on intermittently. It was driving me nuts because I couldn't figure out what was going on after checking the connections on the headlight; which were all good. Long story short I ended up riding with just the spots on for two days until I got home. Some advice from a better wrench than me pointed me to the starter switch. Took it apart, cleaned it up and problem solved. The things we learn from wise wrenches are invaluable . . .