There are two ways of fitting Spratt & Winkle magnets to a model railway layout. This one, or the way I normally do it.
On the layout in a box, as I know where the track will be in advance, I've simple cut a rectangular hole with a big Stanley type knife (this one is from Wilkinson and features an automatic blade replacement system that is very ingenious - I keep fiddling with it and have to re-load the knife) going through both the cork and into the ply top.
Then, using a chisel type Exacto blade, the wood layers have been peeled away until the magnet sits just under the surface of the cork. A dollop of PVA holds it in place. Using proper S&W magnets allows for a small hole. Cheaper versions aren't as powerful so you have to hack away much more.
And the way I normally do this ? The same basically except that the track is usually laid so I have to use a slitting disk in a mini drill to cut the sleeper centres away first. These usually peel off and can be glued back later. It's another reason for using genuine magnets - they will comfortably fit between the rails in OO gauge.