Don't compare transformed instance to nil

MSP-9325

For transformed classes that override ==, using `== nil` and `!= nil`
can return incorrect results, so use the more idiomatic and correct
`nil?`, which is only true for `nil`.