Gauge transformations in string field theory and canonical transformations in string theory