I don't think you need to add foreign keys since all of the fields are named the same.
You can put a check in as you are looping through the columns and provide specific functionality for these two columns.
Something like
<%@ CodeTemplate Language="C#" Debug="True" TargetLanguage="Html"%>
<%@ Property Name="SourceTable" Type="SchemaExplorer.TableSchema" Category="Context" Description="Table that the object is based on." %>
<%@ Assembly Name="SchemaExplorer"%>
<%@ Import Namespace="SchemaExplorer"%>
<%@ Import Namespace="System.Data"%>
<%
SchemaExplorer.TableSchema userTable = SourceTable.Database.Tables["User"];
foreach( ColumnSchema column in SourceTable.Columns )
{
if( column.Name == "ModifiedBy" || column.Name == "CreatedBy" )
{%>
//do what is required
<%}
}%>