Your decision to thank her, explain what she has meant to you, and tell her that you really like her is absolutely the right one (whether in person or by letter). It is possible, although unlikely, that she will then suggest that you continue to have contact outside of school. Asking her if she would like to be your friend outside of school could be awkward for her if other obligations make this unfeasible. Email exchanges are much less intrusive, and you could probably suggest that although it is not the same as face-to-face contact.