You can increase the rent before selling the property, but you must comply with UK law. You must also provide written notice of the rent increase to your tenants before it takes effect.