Transcranial magnetic stimulation (TMS) device with controllable pulse shape