Can I create an animation via script at runtime?

Let me explain:

I want to create (or edit an existing) animation and change the sprites, keys, curves, and transform.
Is it possible for me to do all this via script at runtime, and if so can someone point me in the right direction because I can’t seem to figure it out.

You will likely want to use Animations you have made in the editor and use the Animator Controller state machine, have script control properties that control blending, speeds, and behaviors. You cannot change parts of the animation you make in the editor as they are read-only. As far as doing anything procedural vs. pre-made (or manual) assets, the performance is always better with a pre-made asset because it’s already created and already an asset to be used to and from memory. You don’t have to waste run-time cycles on creating it and you don’t have to figure out how to get it into memory and then have the system read it at run-time in the case of things that are read-only. You would need a custom system for true procedural animations.