Nothing illegal at all about it.
Surge generators are valuable to test engineers. As far as I know, there are no laws restricting their availability or use. (Being test equipment, their price alone probably keeps enough people away.
)
In strong contrast to biological, chemical and mechanical weapons, electrical systems just don't offer enough power density to be a credible threat.
Even rail guns have taken many decades to be realized, on naval ships at that.
The same drawback undermines the realization of practical battery-powered electric vehicles (which are weapons all their own, and regulated to a modest extent -- depending on country). The power and energy density isn't there. Which is not to say they're impossible -- we have real, economically viable examples (well, give or take EV and emissions incentives) today -- but
they will always be at a disadvantage to fuel-air powered machines.
Lab-scale EMP test systems don't fit in a rackmount box, or even a handful of full-height rack cabinets. It's more like, the lab itself must be constructed around the pulse system!
AFAIK, the basic design is to discharge a high voltage capacitor into a network; like any other surge generator system. The network has to be constructed to deliver the desired field strength and waveform, usually to meet a particular standard (such as nuclear EMI, fast or slow type, or explosive-compression or solar storm sources).
The laws of E&M guarantee that, anything you try to generate from an antenna, either requires an impractically massive antenna to produce a directed beam of energy, or requires the target to be very near (or within) the antenna. (Nuclear weapons have the advantage that, by ionizing a layer in the atmosphere, they drive a current through a wall of plasma, using the atmosphere as the antenna itself.)
Tim