Mark an X for the magnet holes in the exact center of the hinged side of the lid and the opposing side of the box.
I prefer to use 1/4″ magnets because they require about 6lbs of force to pull apart. This makes it more difficult to find the secret method of opening. But before drilling, look carefully at the box panel you’ll be drilling into. If it’s near 1/4″ thick, you might end up splitting it or drilling through it with a 1/4″ drill bit. In that case, downsize to 3/16″. Whatever size you choose, drill the holes 3/4″ deep.
Apply a drop of glue to each hole, then push the first magnet into its hole. Speaking with the (embarrassed) voice of experience, I advise you to allow the second magnet to attach to the one you’ve already installed. Then ensure that its opposite end is the one you push into the second hole.
I made one magnet stand 1/16″ proud while the other is recessed 1/16″. This helps prevent the magnets from side-slipping — again making it more difficult to find the secret method of opening.