Cockpits, seats, driver's compartments, and cabins: all exist to provide space for an on-board operator or passenger of a manned vehicle. Transformers who have taken alternate modes based on these manned vehicles have good reason to include a cockpit to ensure perfect disguise. However, there are others who have never imitated a piloted vehicle, who even live on worlds where no suitable pilots have existed since recorded history began, who yet have a place for a driver. How can this be? Only Primus knows the truth.
One of the pre-Transformer toylines, Diaclone included small figurines with magnetic feet for use with most toys. When these toys were carried over to the Hasbro toyline the figures were omitted but the cockpits were retained. This led to several toys that would not logically have had space or even need for a driver featuring an inexplicable cockpit. Toys with this feature include the Dinobots and Insecticons. These were entirely ignored in the fiction, although when the Insecticon were reissued in Japan in 2004, they came with Energon cubes that were designed to fit neatly inside them.
Given the non-vehicle alternate modes of the Beast Era's characters, cockpits are for the most part absent from this time period. However, there are cockpits in Optimal Optimus, Transmetal 2 Megatron, and Tigerhawk's bodies. Coincidentally these three characters all evolved by placing two sparks in their bodies. In early toy designs, these cockpits were shown to hold "spark avatar" called Soul Figures that looked like small versions of the characters. However, Hasbro ultimately cancelled the spark figures in order to avoid confusion over whether the robots had "pilots" by kids. In Beast Wars cartoon series, Optimal Optimus's cockpit was used to house Optimus Prime's spark.