To apply compression to an animation in Unreal Engine, you can assign a Compression Settings asset to an Animation Sequence, using the Compression Settings properties in the Animation Sequence Editor's Asset Details panel.