It's very difficult to move an object independently to match an animation. The standard method is to attach the object to the skeleton of the mesh.
Otherwise, you would need know the precise dimensions of both meshes (character/hand and object) and the movements of the animation at every frame if you want it to look right, which can be pretty resource heavy.
Alternately you would need to do some rather complex computations based on the key-frames of the animation and you would still need to know the precise dimensions of the mesh. You don't want to have to rely on 'magic numbers' like mesh dimension or else when you change the mesh, you need to change your code too and that is bad practice in programming. This is also rather computationally expensive for little gain, especially if you are trying to get the dimensions of the mesh on the fly.
The animator handles all of this complexity for you if you attach your object to the skeleton. Though not perfect, it will almost always be good enough. Your attached object may still penetrate the mesh at some points, since the animator doesn't track the dimensions of the mesh either, just the skeleton.
You might get more accuracy if you animate the object separately from the character mesh so you can make slight adjustments in your object animation to account for variances in how the object should move compared to the hand, but that is usually overkill and that kind of accuracy is rarely needed in a game.