These are two terms that have major similarities but they also have distinctly different functions.
Transposition is simply changing the key of a piece of music or section of music to another key.
Modulation is changing keys within a piece of music, often times coming back to the original key. There can be many modulations within a piece of music.
In the video provided with this article you will hear an example of modulation, where I go from C major, modulate to G major, and then back to C major. This is used frequently in pieces of music to add harmonic interest. Since most pieces end in the keys they started in, often times there is more than one modulation within a piece or movement of a larger work. Modulation is a compositional technique which is written into the score; it’s not something you would generally choose to do with a piece of music.
Transposition on the other hand is used to take something and then play it in a different key. For example, if you were to take a series of chords and then play them again just transposed up a half step, a whole step, or anywhere you would like. This is transposition. If you have ever heard a choir warm up, they might sing a group of notes transposing the series of notes up by half-steps to help the group warm up. This is a classic example of transposition.
Another real world example of transposition would be if you were playing piano with a singer. You want the singer to be comfortable singing in a particular range. Sometimes the songs are available transposed into different keys to put the music in a comfortable range for the particular singer. There are even keyboards now that have a transposition functions that make it simple to transpose your playing into different keys at the push of a button!
Modulation on the other hand is a compositional technique that allows a free flow of tone centers within a piece of music.
I hope this is helpful and if you have any questions about this topic or any other, please email me Robert@LivingPianos.com for more information.