Roughening transition in lattice gauge theories in arbitrary dimension