Bacterial transformation, a common mechanism of horizontal gene transfer, can speed up adaptive evolution. How its costs and benefits depend on the growth environment is poorly understood. Here, we characterize the distributions of fitness effects (DFE) of transformation in different conditions and test whether they predict in which condition transformation is beneficial. To determine the DFEs, we generate hybrid libraries between the recipient Bacillus subtilis and different donor species and measure the selection coefficient of each hybrid strain. In complex medium, the donor Bacillus vallismortis confers larger fitness effects than the more closely related donor Bacillus spizizenii. For both donors, the DFEs show strong effect beneficial transfers, indicating potential for fast adaptive evolution. While some transfers of B. vallismortis DNA show pleiotropic effects, various transfers are beneficial only under a single growth condition, indicating that the recipient can benefit from a variety of donor genes to adapt to varying growth conditions. We scrutinize the predictive value of the DFEs by laboratory evolution under different growth conditions and show that the DFEs correctly predict the condition at which transformation confers a benefit. We conclude that transformation has a strong potential for speeding up adaptation to varying environments by profiting from a gene pool shared between closely related species.