I built a small cage near it and it wakes up instantly and starts walking to it then you can tranq it if you built quick enough

More Megalosaurus Taming & KO Tips