I think the actual legality of it depends on exactly what is modified. I doubt there would be any problems with sh*t like upping the rev limit, or dropping the governor. But if anything with the emissions programming is changed, turned off, or otherwise disabled, that would be a huge red flag and is technically illegal. Just like removing a properly-functioning catalytic converter.