What section of US law they're activated/deployed under determines whether or not they can legally be used in an internal law enforcement capacity.
And generally speaking, federalized forces (either active or NG) cannot ever be used as law enforcement.
Hence why, despite the posturing and marketing of 'sending the military in', this administration is specifically using federalized military forces only in non-law enforcement capacities (and then encouraging the freed up state/local law enforcement to focus on law enforcement).
The national guard was illegally deployed over a fake emergency, but AFAIK the troops themselves did not perform any additional constitutional violations.