Retardation effects and gauge transformations in the Bethe-Salpeter equations