So what does it take to learn an accent as a non-native speaker?
When we hear new sound patterns in an accent or language, we subconsciously categorize them with our own familiar native accent at least initially, and try to produce them as such. The ability to perceive new sounds as they really are instead of as we perceive them to be depends very much on the individual and whether they have “musical ears”. Thorough ear training is the first step. As well as pronouncing the phonological sounds, rhythm and intonation also play a massive part in the character of one's speech.
Rhythmically, English is a stress-timed language, whereby native speakers ‘stretch’ some syllables and reduce others. If the learner’s accent comes from a different system of rhythm, for example a language like Japanese and Mandarin Chinese (whereby different tones affect the meaning of words), or a syllable timed language like French, Indian and Brazilian Portuguese (which distribute rhythm very equally over all syllables) this will subsequently affect the rhythm when speaking English, or likewise of a native English speaker learning their language/accent.
You can listen here to a short sample in English of two native stress-timed accents, British and American English, then two syllable-timed language speakers from France and India speaking English, and hear how the rhythm of syllable-timing effects speech rhythm when transferred to English.
A further challenge facing a non-native learner can be that the student is constantly jumping back into their own language and therefore accent, which affects placement, rhythm and certain sounds, the extent of which depends on the individual. So overall, for anyone wanting to master a non-native accent it takes patience and time to commit to distinguishing your own natural speech patterns from those of the the new accent by listening, finding the rhythmical and tonal nuances, then incorporating them into your subconscious speech reflex with very regular practise. And as the age old saying goes "practice makes perfect.