Off-diagonal heat-kernel expansion and its application to fields with differential constraints