Duality transformations in supersymmetric Yang-Mills theories coupled to supergravity