You can do that with rasterizers, during rasterization. That’s why game engines have such easy time rendering forests of animated trees. It’s purely a shader effect though, albeit a powerful one. But for ray tracers is not that simple.
For example UE4 implemented first usable version of Ray Tracing in 4.22, and now extended the support for many more features in 4.23, including being able to raytrace instanced static meshes and world position offset (the “rendertime deformation” thing) for skeletal meshes. But even they still warn that world position offset does not work on instanced static meshes, so even they have hard time supporting that in UE4 as soon as rays start to get traced. They can render instanced static meshes fine, as long as they don’t have that world position offset shader effect
If it was easy, someone would have done it by now. There’s chance someone will figure it out in future, or we will have so much RAM it won’t matter.
The kind of workaround for now, in offline rendering, to do animated forests, is to have one animated deformed tree and sample it’s animation at let’s say 4-5 specific points evenly distributed along animation time. That doesn’t give you unique animation for each tree, but at least there are 5 unique animations which are often enough. Still, if you have forest made of 4 different trees, each other sampled at 5 different time points, that still means increase to equivalent of storing 20 trees in the memory.
Even easier is to render just one point in time, and have some generic animation of just leaves flapping around. Then render each tree each frame on the exactly same time position. It will still cost same as single tree, but it only works for tiny movements. Not really for trees violently swaying in wind.
On top of that, when trees violently sway in wind in one direction, it means you can not rotate them randomly too much, as they need to follow the wind direction. That means it can now become more obvious that it’s just one or a few same trees instanced, so you may need even more tree variety.
Generally, forest in the wind still remains one of those very hard problems to solve. I’ve broken my teeth on it myself.