this is a very cumbersome sentence.Let us take a look of this sentence.
the methods that a community devises to - the first 'that' is a relative pronoun representing 'methods' giving more detail of 'methods'.Therefore you see the following clause of 'devising to perpetuate ..'
Then we see 2 more 'that' later on and stacking with each other.
Let us look at the first that - this function is to link up the sentence before and after itself
the second 'that' - you already know.But without the second 'that' as a relative pronuon for cultural legacy.
you can say that the sentenc is telling us:A community can come into existence by designing methods to presreving its cultural legacy.
