Generally it's recommended to wait a month before doing so unless your doctor has told you otherwise. You can trim your hair earlier if you'd like to clean up your look in the meantime! Good luck with your results.
If all of the crust are off and you are at least 3 weeks after your hair transplant, then a razor cut should be ok