Relation between probability of a signal and its magnitude spectrum
Given a signal y(t), the magnitude spectrum  is
$$Y(f)=\left\lvert\int y(t)e^{-2\pi ft}\,\mathrm dt\right\rvert,$$
in other words the absolute value of the FT of the signal.

But that's only applicable for deterministic signals¹. If your signal itself is random, then you can't know $y(t)$ – you only know some stochastic properties of it. There's no $y(t)$ to transform if you don't actually know $y(t)$. For random signals, $y(t)$ can't be given, otherwise the signal wouldn't be random. You might observe a realization, but that realization doesn't describe the full stochastic process!
The definition of the power spectral density for random signals like your $y$ is the Fourier transform of the autocorrelation function. For that to be sensibly defined, you need your autocorrelation function to depend only on one variable, the time shift, which means your random signal needs to be wide-sense stationary. But, if that's the case, then the autocorrelation function (ACF) is defined as
$$\phi_{yy}(\tau) := \mathbb E \left\{ y(t) y^*(t+\tau) \right\},$$
and then the power spectral density, which gives your magnitude spectrum is its Fourier transform, $\Phi_{yy}(f) :=  \int_{-\infty}^{\infty} \phi_{yy}(\tau) e^{-i2\pi f\tau}\,\mathrm d\tau$.
Now, in the expectation $\mathbb E \left\{ y(t) y^*(t+\tau) \right\}$, there's your random signals probability density function:
\begin{align}
\phi_{yy}(\tau) &amp;:= 
\mathbb E \left\{ y(t) y^*(t+\tau) \right\} \\
&amp;=
\int_{-\infty}^\infty 
  \int_{-\infty}^\infty 
    y'_1\,y'_2
    \,\cdot\,
    f_{
      (y({t_1}),y({t_1+\tau}))
    }
   (y'_1,y'_2)
    \,
  \mathrm d y'_2
  \;
\mathrm d y'_1
\end{align}
Notice that here, the density is a function of two values, and parameterizes over the time shift.

¹ you're also missing imaginary unit in the exponent and the integration bounds, but that's not the problem here. But, really, make sure to be able to write down the Fourier transform correctly.