Equivalent in RealityKit of SceneKit's SCNAction.customAction to run custom animation

I'm currently converting my game from SceneKit to RealityKit. What's the easiest way to run an animation in which every frame I want to run custom code, similar to SCNAction.customAction which accepts a callback that is called repeatedly until the action completes?

Equivalent in RealityKit of SceneKit's SCNAction.customAction to run custom animation
 
 
Q