Fixed #23493 -- Added bilateral attribute to Transform

https://github.com/django/django/pull/3284 is a prerequisite for that PR as `PatternLookup` uses the same mechanism to turn a "transformed" rhs into some SQL as it does for an `F` expression (relying on `pattern_ops`).

I should also do something about `get_db_prep_lookup` which should not escape and turn the rhs into some `%%%s%%` when using a pattern lookup (e.g. `contains`) as this is handled by `PatternLookup`.

I should work on that soon and update that PR.
would be ideal to describe the issue rather than requiring a ticket reference (I try to avoid them in code, otherwise things could become cluttered)