YOu sit down, and do a mathematical circuit analysis. That's how you get the transfer function, not by staring at waveforms.
I suppose you might also be able to do it empirically by using the AWG to input a massive frequency sweep of sinusoids into the circuit with the AWG and record each the output fo the spectrum analyzer for each input sinusoid frequency, and then record all that data and use MATLAB or some other software to find a best-fit transfer function for your data. It would be a massive pain in the ass though and you need really really in-depth knowledge to do it.