It's likely that the number itself isn't changing, but rather its interpretation by the algorithm. After all, if a hero acquires a skill from a Sorceress, instead of having a chance to obtain it as a new skill, they have a chance to upgrade it. In other words, the skill from the right slot "moves" to the left.
Yesterday, I was playing as Inferno. The Scholar gives Octavia the basic Necromancy skill. After a few levels, I was offered to upgrade it, even though Earth and Logistics were not at the expert level. That is, if the chance to upgrade was equal to the chance to obtain it (which is 0%), then I would only be able to upgrade it when all the skills were at the expert level and there were no free slots. But that's not the case. From the above, it follows that one of two things is true:
1. There are specific probabilities for obtaining a particular upgradeable skill.
2. The skill in the left slot is chosen randomly from the non-expert skills.
I think that option 2 is correct. If anyone knows for sure, please share!