How to write a recommendation letters for an undergrad student applying to transfer to another university? As a new faculty member,
I have just received my first request to write a recommendation letter
for an undergrad student who is looking to transfer
to a more prestigious university.

I taught this student in a class in his first semester,
and have met chatted with him twice informally for about one hour each time
because I am his academic advisor.

What should I write in my recommendation letter?
I have some information about the student,
but I don't know the student as well as
I might know my PhD student for example.
Is there some kind of standard template that I can follow,
so that I can do a good job but also be done with it quickly?

A second smaller but related question.
This student has a very high GPA.
Should I persuade this student to stay,
or let someone in my department know that this student wishes to transfer,
so that someone can persuade him to stay?
Needless to say, I would not try to sabotage his application
by writing a bad reference letter.
A letter for undergraduate admissions need not be long.  Just write what you know about the student.  Since you had him in a course, you can mention his grade and (more helpfully) where he ranked among the students in the course.  Did he ask insightful questions?  Write especially clear solutions? If not, that's fine -- just say what you know.

Since you have spoken with him at length, you can probably also comment on his personality.  Is he easy-going and likeable?  Intensely passionate about his ideas?  Thoughtful and organized?

If you would be sorry to see him leave your program, say so and explain why.