first you should install the NaughtyAttributes
then you can record and play animation
You can create class that has AnimationCurve field and inherits from ScriptableObject with will allow you to save curve as asset file, or you can add [SerializeField] attribute to you AnimationCurve so your changes to curve won't be discarded after script compilation.