Thinking about the speed advantage/penalty:
While apprentice is present, work progress
and master-skill improvement is is slowed directly proportional to the apprentice-skill gain. i.e. a random amount of skill-points normally due to the crafter[1] are assigned instead to the assistant, and a relative number of 'ticks to completion' are added to the time it will take (or 'ticks progressed' negated, however it is best modelled). This represents the expert going through a technique they know well with care and attention to demonstrate, at the expense of some personal opportunity for discovering a new finesse.
If it were me, I'd use an S-curve function to the the way the apprentice goes from zero to master's level (a moving target, but here 'proportion of target') with non-zero gradients at each end (always possible to learn a little as no-skill novice, always possible to go above the target when got to equal skill... for aforementioned reasons, best learning rate when not completely clueless nor lmost up-to-speed) and maximum gradient in the centre, or (in derivative terms, which is how it would he calculated, per-instant) effectively a standard distribution of gain, pegged to maximum (near, but not 100% benefit-leaching in the centre-X, both tails located at "round down to non-zero" values at the 0..complete range of X). (Dis)aptitude to the skill could shift this, somehow. Perhaps the effective Teaching skill of the trainer (though I was thinking more along the lines of greater Teaching aptitude mitigating the trainer's skill-gain loss, only, like only a fracteaching of the skill granted to the learner is lost by the trainer).
This is meant to reflect the totally clueless assistant not worth much time taken to explain, and the onebclose to 'graduation' not needing/benefitting much from it, but a half-decent apprentice has earned some attention.
OTOH, some might argue the proportion-deferred-to-learner should go from 100% at utter novice to (nearly?) zero at utter-equal (straight gradient between?) because of the near constant hand-holding required at the start, or something.
A compromise could be the mean of the two lines (normal dist and negative gradient) giving a downward (plateau-ish centred) S-curve of derivative gain (path of XP from zero to max therefore being a sort of 'r' curve). Or perhaps master-XP 'lost' works as the -1ish gradient but Apprentice-XP gain as the normal dist, with different amounts of adjustment due to each party. But that needs to be checked not to give more net skill-gain than without an apprenticeship relationship (even/especially after any Teaching Ability adjustments).
These graphs are all in my head, right now. I imagine that nobody cares for me to put them into graphics, to better explain the words, but I could if anyone is bothered...
But when the Apprentice is
not present, the master works as normal, gaining personal XP to the skill as if without (nothing skill-related going to the student-worker). The clincher being that the assistant (when free to Assist), the closer in skill to their tutor they are, will
anticipate the next material needed in the job-queue/R in advance of task completion and go off and get it, to bring it back and *TSK* it into the given workshop(/zone?), so that they do that legwork and their senior does not have to, to speed up the transition time (would have wait, rather than get their own candidate material(s), if the assistant was still bringing the thing(s) back - could be a detriment if the strength and therefore haul-speed was sufficiently different between the two, or burrow/whatever differences made it delayed). Lack of material-to-get would prevent any prefetch (message, as per "Job Cancelled, No MAT available", but no delay until prior work completed, by which time maybe a precursor stage had created/freed-up the required MAT.
(Simple Matter Of Coding, etc, although I'm trying to base this off modifications/expansions to the current code, insofar as it can be implied to be.)
[1] Includiing, if applicable, "skill overflow" points that already do nothing to raise them above Guru-level expertise, if they're basically a Yoda-of-the-Forge, or similar.