We investigate epsilon-deformed N=2 superconformal gauge theories in four dimensions, focusing on the N=2* and Nf=4 SU(2) cases. We show how the modular anomaly equation obeyed by the deformed prepotential can be efficiently used to derive its non-perturbative expression starting from the perturbative one. We also show that the modular anomaly equation implies that S-duality is implemented by means of an exact Fourier transform even for arbitrary values of the deformation parameters, and then we argue that it is possible, perturbatively in the deformation, to choose appropriate variables such that it reduces to a Legendre transform.