Catalysis of the reaction: N,N-dimethylglycine + electron-transfer flavoprotein + H2O = sarcosine + formaldehyde + reduced electron-transfer flavoprotein.
N,N-dimethylglycine:acceptor oxidoreductase (demethylating)