If for example I had a torchick with speed boost (pokegen) in Black 2 will I be able to safely transfer it to X and Y with pokebank as it is a hidden ability in those games?
Yes,it would. Pokebank stops Pokemon that have illigal stats movesets etc regardless of Pokegen.According to Bulbapedia's page on Dream World Pokemon,HA Torchic was released.So your Torchic will go through pokebank.
Hope I helped!