Judge warns doctors over trans hormone consent