How to create animation physics sequence automatically?

Hi, I try to find out how epic save physics simulate results as anim sequence and I wanna create a plugin that can save sequence automatically in a certain file.
I did find how they record the animation but I dont know how they create such window in the editor.
can anyone help me on that?

the function is OnKeepSimulationChanges() in LevelEditorActions.cpp
image