What you propose (3 branches) would certainly work, but if I were to do it, I'd probably make 3 git repositories rather than 3 branches.
There is no way for git to automatically merge the master branch (your shared library) into the two implementation branches. You would need to do that yourself.