Was transformers based on a true story?

Yes. Transformers started out as a Hasbro toy line then was made into a Marvel comic book series, then a TV series, then they came to life and started having robot death matches and then came the movies. All hail Megatron