Hi there. I see that people haven't answered you for a while. Now I kind of understand why. It's pretty hard to answer this question without a certain degree of music theory. First off, I need to explain that what you are talking about is modulation not transposing. Simply put, modulation is changing key during your piece to add harmonic variance to the composition Here is a great video explaining the difference, with musical examples. https://livingpianos.com/what-is-the-difference-between-modulation-and-transposition-in-music/
So, you want your melody in C major, to play it in D major possibly coming back to C major afterwards. That is modulation. To simply do that inside the edit window you would select the event, highlight all the notes you want to change and find the first note of the piece. If this is on the C note, just drag the highlighted section and move the first note from C to D. This will adjust all the notes you have highlighted, keeping their relation to the root, to the key of D major. This will automatically adjust the accidentals too. That is if you are editing midi stuff. I could go further but it involves a bit more advance theory on modes given your example and that is a subject that is very open ended and beyond the scope of a Presonus forum post.
I hope that helps you some way.