if you are not interested in measure uniform acceleration (but e.g. only harsh events), on most of ST accelerometers (let's say from LIS3DH family on), you can set an HP filter to remove the DC component from the 3-axis output signal, removing also the 1g gravity.
[in the other case, yes, you can remove the 1g value from the intensity of the 3-component vector, or referring to an initial known value/direction]