Square Wave transfer function
Take the Laplace transform of the input and output signals, and divide one by the other. In this particular case the signals are piecewise linear.

For (simple!) example, if the input is a unit step, and the desired output is a unit ramp for 1 sec, followed by a constant value of unity, the input and output signals would be: \$\frac{1}{s}\$ and \$\frac{1-e^{-s}}{s^2}\$, respectively, and the required TF would be: \$\frac{1-e^{-s}}{s}\$.

In some cases the resultant TF may not be physically realisable, since term(s) in \$\small e^{-sT}\$ may arise in the TF denominator. I suspect this is the case for your application. Approximations, such as a Pade approximant, may then prove useful.