captive consumption by the same unit is not a supply. (it is part & process of manufacture) captive consumption by a another unit within same state is not taxable. captive consumption by a unit in another state is taxable.
Read more at: https://www.caclubindia.com/forum/captive-consumption-in-gst-407249.asp
If both the Units are in same state under single GST registration then its not supply thus not taxable , but if both the Units are in different state , its taxable . A unit will charge GST & B unit can take ITC on same