A ticket is not transferable. The conditions of carriage say that it can only be used by the person for whom it was bought.
Some styles of ticket do have a name printed on them. It is not necessary for the name to be that of the person travelling. If though, the name on the ticket was of a female and a male was travelling it might attract the attention of a jobs-worth conductor, particularly on the return journey when he might suggest that the person using it was not the same one who had used it on the outward journey.
Having said that, I'm not aware of any self-service machine that prints the purchaser's name on the ticket. As far as I know only (some) airline-type tickets that have a name on them and they are not produced by self-service machines.