Subspace is an extradimensional space which can be used by Transformers to store things. It can also be used (in one continuity, anyway) as a medium for faster-than-light communication, and is a place where sparks can become lost.
While this description is mostly technobabble, it does make clear that subspace can be used to store parts of a Transformer's body, yet still allow those parts to retain a connection with the rest of the body in "normal" space.
The idea that Transformers can store equipment or portions of their body in an extradimensional space has been popular in fandom for decades. Most famously, in the original cartoon, Optimus Prime's trailer will often conveniently slide into the frame when he transforms to truck mode, thus suggesting either A) that it is constantly following him around, but carefully staying where the camera can't see it, or B) that it appears out of subspace. In Beast Wars, characters would draw their guns by reaching behind themselves, and then bringing their hands forward, now holding a gun, despite the fact that any shot of the characters' backs did not show a rear holster or anyplace to keep a weapon. Where did the guns come from? Subspace. This concept also figures prominently into many fanon explanations of size changing. Also, in the Cybertron anime, Optimus Prime's "Super Mode" exists only on his main frame and the parts of his Earth alt mode. It seems to disappear when he transforms into humanoid mode.