This paper describes a novel tool for closed-loop system identification of the activation dynamics of the neural target of transcranial magnetic stimulation (TMS). The method operates in real time, selects ideal stimulus parameters, detects and processes the response, and estimates the input--output (IO) curve and the neural membrane time constant representing a first-order approximation of the activated neural target. First, the neural membrane response and depolarization factor, which leads to motor evoked potentials (MEPs) are analytically computed and discussed. Then, an integrated model is developed which combines the neural membrane time constant and the input--output curve in TMS. Identifiability of the proposed integrated model is discussed. A condition is derived, which assures SPE of the proposed integrated model. Finally, a real-time and sequential parameter estimation (SPE) formalism is described to identify the neural membrane time constant and IO curve parameters in closed-loop TMS, where TMS pulses are administered sequentially based on the automatic analysis of the electromyography (EMG) data in real time. Optimal sampling based on maximization of the Fisher information matrix (FIM) and more conventional and intuitive uniform sampling methods both are addressed in this paper. The effectiveness of the proposed parameter tuning method is evaluated via simulations. Without loss of generality, this paper focuses on a specific case of cTMS pulses. The method is directly applicable to other cTMS pulse shapes with no new point of principals. The Matlab code is available online on Github.