Formation of territorial community as a subject of local development