How to assign BUILD_USER_ID to another env variable?

Hi, I want to use environment variable BUILD_USER_ID to build a path, for use as a global variable, environment variable or parameter in a declarative pipeline.

I understand how to access BUILD_USER_ID within a stage:

    steps {
        wrap([$class: 'BuildUser']) {
            script {
                echo "Jenkins_${BUILD_USER_ID}"
            }
        }   
    }

but how can I assign that value to an environment variable, parameter or global variable?

This fails:

wrap([$class: 'BuildUser']) {
    environment {
        USER_DIR = "Jenkins_${BUILD_USER_ID}"
}