There are several ways to do this, but one of the easier ways would be to use an "intersect" list operation. The result of this list operation between your Traineelist and your $Trainee will be empty if none of the elements in either list (where the second is a list of 1 object) are equal to one another. If $Trainee is present in both, the list should return $Trainee and you can do an empty check on that.
Alternatively, which is the cleaner but slightly more difficult to write solution, you could do a straight retrieve from database where you retrieve over the same association as now, but you also check if "id = $Trainee". That should only return the same object if it exists over that association. You can then either do a count on this list and check if the count is equal to zero (the most performance-friendly way) or you can set the retrieve range to "first" and do an empty check.