Do you need to use bearer token in source transformation? Or, Do you need to generate token for use by "External Call" transformation?
Usually I recommend getting Bearer token by "Web" activity, and give it via parameter to the Data Flow.
I think it may be possible to generate token in "Source" transformation, but the details depend upon who the token is for. If the token is for Azure service, there are few URLs, and then you need audience/resource URL. If the token is for outside Azure, then that service has different URL to get token from.