While nanowires show increasing promise for optoelectronic applications, probing the subwavelength details of their optical modes has been a challenge with light-based techniques. Here we report the excitation of dielectric optical waveguide modes in a single GaN nanowire using transition radiation generated by a 1 nm diameter electron beam. This spatially resolved study opens important gateways to probing the optical modes of more complex nanostructures, fundamental for optimization of optoelectronic device performance.