A generalized Fourier transform approach to risk measures