How to find a transformation of a random process X to make it distributed as a reference process Y?

I am thinking how to use GAN or KL Divergence as a loss function to enforce specific specific distribution on the feature space:

Let $$X \sim D$$ where $$D$$ is some distribution. Assume we know a reference asymptotic distribution $$Y \sim D_2$$.

We would like to find a polynomial transformation of $$X \to f(X)$$ such that $$f(X) \sim Y \sim D_2$$.

For the case of $$Y \sim D_2=N(0,1)$$ the network potentially will find the z-score normalization or some mapping $$f$$, so $$f(x) \sim Y$$.

I would like to get advice how to formalize this problem in order to be able to solve it using Neural Network.

Someone mentioned something like: Quantile Transforms, but I want to use neural network.