Outside of the
-w receive options,
hackrf_transfer always deals in 8-bit signed IQ samples, raw with no file headers.
You must also make sure that the sample rate of the data matches the sample rate specified on the command line and is a rate supported by the HackRF hardware. WAV files contain the sample rate information in a header, but raw files have no place to put it, and in RF signals it can be undesirable for programs to attempt automatic sample rate conversion anyway.
Before considering converting a WAV file, you need to ensure you actually have RF (IQ) samples, not audio; that is, it must be modulated. If you got the recording from another program which explicitly says it produces IQ output, then that's fine.
If you have audio data, and the signal is intended to be fed to a single-sideband (SSB) transmitter, such as most HF digital modes, then you can use it anyway, but you will get double-sideband (DSB) transmission — two copies of the signal, one with the spectrum inverted. This may be adequate for testing purposes, but don't make a habit of it as you're wasting bandwidth.
If you have audio data which is intended to be modulated as FM (such as an AFSK APRS packet, for example), then you will need to modulate it. This can be done fairly easily given the right tools, as I will describe below.
I recommend that you install GNU Radio. While it is primarily intended for real-time processing, and can in fact talk directly to the HackRF One, it can also be used to convert files.
In GNU Radio's graphical tool, GNU Radio Companion, you can design a "flow graph" to read a file, write a file, and do any particular conversions along the way, such as for your case:
Here we take the two “stereo” channels of the WAV file (which GNU Radio automatically converts to floats in the −1 to +1 range), put them in alternating left-right-left-right sequence, resample it from an assumed rate of 44.1 kHz to 2 MHz (that being the minimum supported by the HackRF One), rescale to −127 to +127, and write to the raw output file (which will have the same sample rate as the input file).
If you needed to perform modulation (as I described above) as well, that would be just another block or two in this chain.
Unfortunately, GRC does have some limitations — for example, this has the filenames hardcoded into it. But GRC generates (overly verbose) Python programs which you can then clean up into something reasonable, or write from scratch once you're familiar with the vocabulary.
There is a lot to learn to use GNU Radio effectively, but it is a very useful tool for SDR experimentation, if with some rough edges, and I recommend it.