How do I get the transfer function from this step response?
You should not do T = feedback(H,1), just do step(H).
The output you have is already the result of the whole system (the whole closed-loop system, not the plant that will then have a feedback), so you should just do step(H) and you will get something similar to the oscilloscope measurement. In order to further break down the identification into what is the behavior of the controller and what is the behavior of the plant you would need more measurements.
Also, as Marko Buršič mentioned, the system is nonlinear and your approximation will not look\behave exactly as the original system. But I would not go as far as he did in saying that &quot;you can't estimate it with 2nd order linear system&quot;. In many cases you can get away with approximating nonlinear systems with some 1st, 2nd or Nth order transfer function. But it will be up to you to evaluate if that 2nd order TF will be enough for your problem.