1. Reinforce your raft with stone foundations, they won't be able to break them.
2. Make them attack your raft and shoot at them with tranq arrows (Bow and crossbow can both be used but a crossbow will be quicker) when they swim away because they are almost unconscious make sure you hit all the arrows you shoot so they won't escape.
3. Tame them with the food of your choice (high level Megalodons will need some narcotics or bio toxin, you won't need it immediately but be prepared).