How to pass groovy output to pipeline variable
You can send the output of your python script to stdout and capture it in a environment variable and that variable can be passed to other stages in the pipeline. Also, the environment variables can be used inside the scripts.

You can do something like this:

def call(Map parameters)
{
    def CREDENITAL_ID = parameters.secret
    def DOMAIN_DESCRIPTOR_URL = parameters.url
    env.artifacts = sh(script: "python amd_distribution_input_transformation.py", returnStdout: true )

    }             
}


Here, the output of the script amd_distribution_input_transformation.py will be stored in the variable artifacts and will be available further.