The timing can be tricky, but I think you can do it with any companion. Dogmeat seems to be the easiest.
The gist of it is, you drop the SPECIAL book, take a few steps back and tell your companion to pick it up. Then you step forward and snatch it just as the companion goes to do it. It's easiest with Dogmeat because he has a distinct visual cue that tells you he's beginning the pickup animation. He will walk up to the book, stand still for a brief second and then pick it up. If you hit the pickup button while he's standing still you grab a copy of the book and then he drops a copy for you. One will be a new copy. Rinse and repeat ad nauseum. But it does get easier with practice. Can be used to copy anything, afaik, but magazines will not work at all and bobbleheads will copy but not confer any extra bonuses after picked up the second time. Mostly useful to copy expensive weapons for resale if you're low on ammo or need another power armor frame.
Also: If you max out your specials prior to picking up any bobbleheads the bobbleheads will put you over 10.
Also also: If you use alcohol or chems that drop your specials temporarily you can use the book trick to boost over 10 as well.
Example: Use a daytripper to lower your strength from 10 to 8, then use the book trick twice to boost your strength. When the daytripper wears off you will have a strength of 12. Add the strength bobblehead later on and you're at a natural 13 before any equipment or further chem boosts.