Dylan's behavior seems so inexplicable that he is willing to sell humanity. When the bridge stopped he could have just got the hell away from there but no he had to fix it. Then it struck me. He is so damn chummy with Soundwave. That basically he called "What the Hell Villain" on him with keeping prisoners. Sure BB shooting at him played part on that but he pretty much understood Soundwave. He and Soundwave are the evil counterparts to Sam and BB. He did say to Sam that "He wasn't the only who chosen to join an alien cause". Here is what I think happened to Dylan. Soundwave was probably around for most of his life and he developed Stockholm Syndrome with Soundwave. Though he does think Megatron is a dick.