This is a "squinting" modifier. This means placement can affect meaning. In your examples, "I only have 10 apples in this basket", the meaning is "I alone" have ten apples. By the way, "have" is not an auxiliary here, but the main verb. In the case of "I have only 10 apples", then you have merely ten. In the second set of examples, I think the meaning is clear either way, but "I will be only a teacher" is better.