To handle a sq wave, you need a transformer that will handle a broad frequency range, as the fourier transform of a sq wave has all these components in it (odd harmonics). The rule of thumb is at least 10x to get something that still looks good on the other side -- eg get the harmonics through the 9th or so. You have to have at least 3 and 5 or it's going to look pretty ugly.
In other words, to have a sq wave coming out at 5 mHz, you need a transformer that will handle 5-50 mhz, roughly. It's a lot easier with a narrow band signal (sine) or if you don't care if the output is more sine-like. That happens all the time in our HV supplies -- we put in a sq and get a sine out pretty often. If you only need a sine, and you can deal with retuning when you change frequency, there's a bunch of easier (and cheaper) ways to get this done. The popular Pi network comes to mind for that, and can do quite high stepup/down ratios easily. (radio amateurs handbooks show these and some design info).
Yes, you use a ferrite, probably, for this, and not the same type as for a switching power supply, they have far too much core loss at these frequencies. You get a lower mu one designed for the range of interest. Usually in this range, you'd use a ring core of fairly low mu, and wind primary and secondary windings on it all around. The mu of the good HF cores is low enough that if you wind a primary on one end of the ring, and the secondary on the other end, there's enough magnetic leakage to make it not work very well at all. So you have to put the secondary winding over the primary, for example, and usually wind around the whole circumference. Users of large, low mu cores are kind of rare, so they can be hard to find and not real cheap.
Typically, you design for primary inductance impedance about 4x the driver impedance at the frequency of interest, if you can, so the transformer itself doesn't load the driver too badly.
You can't use an "open collector" type drive and get a good waveform, as you store some energy in that inductance, so you have to drive it both ways, and with no net DC across the primary.
Also, you have to stay inside the flux that the core will saturate at. Suddenly turning off a single sided driver will give you a "kickback" that can be many times the original drive volts.
(an auto spark coil goes to nearly 600v when the points open, on the primary, for example)
The main problem with a broadband transformer is going to be self resonance of the winding stray capacity with the winding inductance, usually the one with more turns is the one that gets you in trouble.
Here's a place that sells the right type. The K type for ham baluns looks good here, but of course you'll have to do the figuring on the windings.
https://www.amidoncorp.com/You might find others. It's a weird business, most of the suppliers won't sell small lots, these guys will. Nearly all surplus will be the high mu low frequency type stuff. Or the deliberately lossy stuff used for ferrite beads to eat noise.
For a one-off, you're probably not going to need or want to find the very smallest core that can work, and more meat makes things much easier. The manuf's will usually give you some info on the inductance per n turns, but I find it's best to simply wind some and then measure by using a capacitor and a signal generator/scope to find resonance.
Hint -- when you first test, start with low voltages and gradually crank up to make sure you're not driving the thing into saturation -- your driver won't like that very much at all, as it will look like a short circuit when you attempt to drive past that point. Perhaps a small series R that driver can fry easily in there is a good idea, and watch for it getting hot at first.
Large turns ratios tend to get you in trouble with self resonance too low, as the inductance goes up with the square of turns, and the capacity also goes up linear with turns, so you hit a wall with that if not done carefully.
When you can, it's better to start with all the volts you can get to keep the turns ratio down. I find TV horizontal flyback driver tubes are the cheapest way to get to the kV range, and as beam power tubes, a lot easier to drive than old high power transmitting tubes with similar voltage ratings. You can run, for example, a 6KD6 at around 1.5kv on the plate supply for 3kv pk-pk with only about 100v drive to the grid if you hook it up right. Whereas a big transmitting triode might need a few times that drive, and also need to be "neutralized" so it doesn't oscillate at some odd frequency. (Chris, I know you don't want to have to build another driver but others may read this) 6kd6 is rated for 7kv peak on the plate, but at that point you need so much grid bias to turn one off, it's hard to handle. I am using a CRT cathode driver chip to drive my tubes grids, they work great, but I also bought a lot of them as CRT's are going the way of the dodo, and semi makers quit making cool stuff like that as soon as order volume drops. The chip takes me from a couple volts to 90 or so, with some oomph to drive the grid capacity.
At any rate, I'm doing some RF/arbitrary waveform work here (for similar reasons), and have the same problem. Right now it's on the burner behind the data aq /data mining stuff, but I'll be getting to it soon myself. Pretty much the same problem, only I need even higher voltage output and broader bandwidth (so I think right now). The transformer guys don't like to hand out the secrets of doing this well, or those AR or ENI broadband power amps wouldn't cost more than a new car (and that's used on ebay!) for long. The best I've been able to pry out of one is sort of "make the best air core one you can, then stick in some ferrite to get it to work at lower frequencies". Which is how I plan to start. In my case, I'm going to begin with windings on pvc pipe, one inside the other, and then stick in some ferrite rods....I'll need the insulation I get that way, and can maybe tolerate the weird impedance that's going to hand me on the driver side better, as I have some practice with that issue.
I believe we have some ace RF guys here who might know more than me about this -- ya'll chime in. I mostly just did ham type things, up to about 2kw or so.
Posting as just me, not as the forum owner. Everything I say is "in my opinion" and YMMV -- which should go for everyone without saying.