How to establish transfer function of a speaker?
You can use a spark gap to measure the impulse response of the microphone. Spark gaps discharge within a very short time interval, producing a very broad spectrum that is effectively constant in the audible range.

If you also make sure that reflections that reach the microphone are arriving much later compared to the duration of the impulse response, you can separate the room response very well from the microphone response. Repeated measurements improve the estimation.

With the microphone response known, you can solve for the speaker response. However, technically you still have the room response and directional dependence of the speaker and microphone that you might want to consider.