Legacy JavaScript
The Legacy JavaScript insight detects the use of polyfills or transforms for JavaScript features which are already widely supported by most modern browsers.
In other words, their use is applicable to much older browsers that most websites no longer need to support.

Polyfills and transforms enable older browsers to use new JavaScript features. However, many aren't necessary for modern browsers. Consider modifying your JavaScript build process to not transpile Baseline features, unless you know you must support older browsers. Learn why most sites can deploy ES6+ code without transpiling
Understanding Legacy JavaScript
This insight means your site is using old JavaScript rules for browsers that don’t need them, which should be avoided.
If more than 5 KB of polyfills or transforms are detected for JavaScript features that are widely supported according to Baseline, then this insight fails.
How to improve Legacy JavaScript
WP Rocket cannot fix this for you, as the underlying JavaScript code must be updated by its developer.
However, since its impact may not be noticeable for the visitor experience, you may be able to safely ignore it.