You can use simulation software for exampe DIgSILENT PowerFactory and run RMS simulation to get the curve of the change of frequency over the time .
You also have several good papers in which mathematical equations are given for such computation. Swinging curve equation need to be solved how df/dt can be calculated.
In the following paper, you will find a method for determining the ROCOF and estimation of the resultant inertia at any bus. In addition, some other issues are presented. The method is based on mathematical simulation of the hardware; however, it can be used directly from the hardware data loggers or monitoring systems after filtration processes.
In addition, in the following book, details of the estimation of the ROCOF and inertia are presented considering various models and controls of synchrounus generators used in traditional power generation.