how do I record/convert changes to shape keys and/or transforms done by a script over time to a key frame animation?

I have a script that visualizes audio by changing the transform or shape keys from meshes in my scene.
And I would like to record or convert what this script does to my meshes into an animation.
How would I go about doing this?

Found this: GitHub - newyellow/Unity-Runtime-Animation-Recorder: Record animations in Unity runtime. Can save to .anim, maya, or FBX ASCII format.
Works perfectly and was exactly what I needed :).